Skip to main content
Glama
srafi26

MCP Server

by srafi26

echo

Echo back input text to verify communication and test connectivity in the MCP Server environment.

Instructions

Echo back the input text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesThe message to echo back

Implementation Reference

  • The handler that implements the core logic of the 'echo' tool by validating the input message and echoing it back as text content.
    case 'echo': const message = validateString(args.message, 'message'); return { content: [ { type: 'text', text: message, } as TextContent, ], };
  • The JSON schema defining the input parameters for the 'echo' tool, specifying a required 'message' string.
    inputSchema: { type: 'object', properties: { message: { type: 'string', description: 'The message to echo back', }, }, required: ['message'], },
  • src/index.ts:30-43 (registration)
    The registration of the 'echo' tool in the tools array, which is served via the ListToolsRequest handler.
    { name: 'echo', description: 'Echo back the input text', inputSchema: { type: 'object', properties: { message: { type: 'string', description: 'The message to echo back', }, }, required: ['message'], }, },
  • Helper function for string input validation, used by the echo tool handler.
    const validateString = (value: unknown, fieldName: string): string => { if (typeof value !== 'string') { throw new Error(`${fieldName} must be a string`); } return value; };

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/srafi26/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server