example_tool
Process messages efficiently within the Model Context Protocol Server framework to extend Claude's capabilities and enhance user interactions in the desktop client.
Instructions
An example tool that processes messages
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | Message to process |
Input Schema (JSON Schema)
{
"properties": {
"message": {
"description": "Message to process",
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
Implementation Reference
- src/tools/ExampleTool.ts:19-21 (handler)The main handler function that takes an ExampleInput and returns a processed version of the message.async execute(input: ExampleInput) { return `Processed: ${input.message}`; }
- src/tools/ExampleTool.ts:12-17 (schema)Input schema definition using Zod for the 'message' parameter.schema = { message: { type: z.string(), description: "Message to process", }, };
- src/tools/ExampleTool.ts:4-6 (schema)TypeScript interface defining the input shape for the tool.interface ExampleInput { message: string; }
- src/tools/ExampleTool.ts:9-9 (registration)The name property that registers/identifies this tool as 'example_tool'.name = "example_tool";