Skip to main content
Glama
srafi26

MCP Server

by srafi26

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
NameRequiredDescriptionDefault
messageYesThe message to echo back

Implementation Reference

  • 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, ], };
  • 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'], }, },
  • 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; };

Other Tools

Related Tools

  • @epicweb-dev/epic-me-mcp
  • @wj-yuta-imai/mcp-server
  • @piebro/echo-mcp-server-for-testing
  • @shaleen-wonder-ent/simple-mcp-server
  • @balajidommeti/MCP
  • @avi892nash/purescript-mcp-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