echo
Return a provided message as a response using the Simple MCP Server. Use this tool to validate message transmission or test integration with the MCP protocol.
Instructions
Echo back the provided message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | The message to echo back |
Implementation Reference
- src/index.ts:98-108 (handler)The handler function for the 'echo' tool that parses input arguments using EchoArgsSchema and returns a text response echoing the provided message.case 'echo': { const parsed = EchoArgsSchema.parse(args); return { content: [ { type: 'text', text: `Echo, from the MCP Server:==> ${parsed.message}`, }, ], }; }
- src/index.ts:24-27 (schema)Zod schema definition for validating the input to the 'echo' tool, requiring a 'message' string.// Schema for the echo tool input const EchoArgsSchema = z.object({ message: z.string().describe('The message to echo back'), });
- src/index.ts:43-56 (registration)Tool registration in the ListToolsRequestSchema handler, defining the 'echo' tool's name, description, and JSON input schema.{ name: 'echo', description: 'Echo back the provided message', inputSchema: { type: 'object', properties: { message: { type: 'string', description: 'The message to echo back', }, }, required: ['message'], }, },