Skip to main content
Glama

echo_tool

Test MCP clients by sending messages and receiving identical responses to verify communication protocols.

Instructions

Echo a message as a tool

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYes

Implementation Reference

  • The main handler function for the echo_tool that processes the input message, logs info, retrieves SECRET_KEY from environment, and returns the echoed response.
    async def echo_tool(message: str, ctx: Context) -> str: """Echo a message as a tool""" SECRET_KEY = os.getenv("SECRET_KEY", "No secret key found") await ctx.info(f"Processing echo request for message: '{message}'") return f"Tool echo: {message}. The environment variable SECRET_KEY is: {SECRET_KEY}"
  • The @mcp.tool() decorator that registers the echo_tool with the MCP server.
    @mcp.tool()

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/piebro/echo-mcp-server-for-testing'

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