Documentation Index Fetch the complete documentation index at: https://spec.conveniencepro.cc/llms.txt
Use this file to discover all available pages before exploring further.
Example Tools
Complete reference implementations demonstrating CTP patterns.
Available Examples
JSON Formatter Format and beautify JSON with customizable indentation
Base64 Encoder Bidirectional Base64 encoding and decoding
Hash Generator Cryptographic hashing with Web Crypto API
Pattern Summary
Example Pattern Key Concept JSON Formatter Sync tool Multiple parameters, validation Base64 Encoder Bidirectional Mode selection, conditional params Hash Generator Async tool Web Crypto, warnings in metadata
Quick Reference
export const jsonFormatterFn : ToolFunction < Result > = ( params ) => {
// Synchronous processing
const formatted = JSON . stringify ( parsed , null , indent );
return { success: true , data: { formatted } };
};
export const hashGeneratorFn : ToolFunction < Result > = async ( params ) => {
// Asynchronous - uses Web Crypto
const hash = await crypto . subtle . digest ( 'SHA-256' , data );
return { success: true , data: { hash } };
};
export const base64Fn : ToolFunction < Result > = ( params ) => {
const mode = params . mode as 'encode' | 'decode' ;
const output = mode === 'encode' ? encode ( input ) : decode ( input );
return { success: true , data: { output , mode } };
};
Running Examples
Clone Repository
git clone https://github.com/titan-alpha/convenience-pro
cd convenience-pro/packages/ctp-examples
npm install
Run Tests
Try Interactively
npm run dev
# Opens interactive tool runner
Creating Your Own
Use examples as templates:
// Copy a similar example
cp src / tools / json - formatter . ts src / tools / my - tool . ts
// Modify definition and function
// Register in src/registry.ts
// Add tests in src/__tests__/