echo
Send text input and receive it as output, aiding in testing message handling or verifying communication processes on the MCP Server.
Instructions
Echo back the input text
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | The message to echo back |
Implementation Reference
- src/index.ts:113-122 (handler)The handler logic for the 'echo' tool: validates the input 'message' and echoes it back as text content.case 'echo': const message = validateString(args.message, 'message'); return { content: [ { type: 'text', text: message, } as TextContent, ], };
- src/index.ts:33-42 (schema)Input schema for the 'echo' tool, defining a required 'message' string parameter.inputSchema: { type: 'object', properties: { message: { type: 'string', description: 'The message to echo back', }, }, required: ['message'], },
- src/index.ts:30-43 (registration)Registration of the 'echo' tool in the tools array, including name, description, and schema.{ name: 'echo', description: 'Echo back the input text', inputSchema: { type: 'object', properties: { message: { type: 'string', description: 'The message to echo back', }, }, required: ['message'], }, },
- src/index.ts:13-18 (helper)Helper function used in the 'echo' handler to validate the 'message' parameter as a string.const validateString = (value: unknown, fieldName: string): string => { if (typeof value !== 'string') { throw new Error(`${fieldName} must be a string`); } return value; };