echo
Reflect a message back to the caller to verify input or test server connectivity. Returns the input unchanged, aiding in debugging and development.
Instructions
Echo a message back to the caller
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | Message to echo |
Implementation Reference
- src/index.ts:15-17 (handler)The async handler function that echoes the message back: returns { content: [{ type: 'text', text: `Echo: ${message}` }] }
async ({ message }) => ({ content: [{ type: "text", text: `Echo: ${message}` }], }) - src/index.ts:14-14 (schema)Input schema: a required string 'message' validated via Zod with description
{ message: z.string().describe("Message to echo") }, - src/index.ts:11-18 (registration)Registration call: server.tool('echo', 'Echo a message back to the caller', schema, handler)
server.tool( "echo", "Echo a message back to the caller", { message: z.string().describe("Message to echo") }, async ({ message }) => ({ content: [{ type: "text", text: `Echo: ${message}` }], }) );