Skip to main content
Glama

echo_tool

Test MCP Ahrefs integration by echoing input messages with automated exception handling and logging for SEO tool development.

Instructions

Echo back the input message.

This is a simple example tool that demonstrates basic MCP tool functionality. It will be automatically decorated with SAAGA decorators for exception handling and logging. Args: message: The message to echo back Returns: The echoed message with a prefix

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYes

Implementation Reference

  • The core implementation of the echo_tool handler. This async function takes a string message as input and returns it prefixed with 'Echo: ', demonstrating basic MCP tool functionality.
    async def echo_tool(message: str) -> str: """Echo back the input message. This is a simple example tool that demonstrates basic MCP tool functionality. It will be automatically decorated with SAAGA decorators for exception handling and logging. Args: message: The message to echo back Returns: The echoed message with a prefix """ return f"Echo: {message}"
  • echo_tool is included in the example_tools list, which collects tools for automatic registration with SAAGA decorators.
    example_tools = [ echo_tool, get_time, random_number, calculate_fibonacci ]
  • Server-side registration loop that applies SAAGA decorators (exception_handler and tool_logger) to each tool in example_tools (including echo_tool) and registers them explicitly with the MCP server using mcp_server.tool(name=tool_name).
    for tool_func in example_tools: # Apply SAAGA decorator chain: exception_handler → tool_logger decorated_func = exception_handler(tool_logger(tool_func, config.__dict__)) # Extract metadata from the original function tool_name = tool_func.__name__ # Register the decorated function directly with MCP # This preserves the function signature for parameter introspection mcp_server.tool( name=tool_name )(decorated_func) unified_logger.info(f"Registered tool: {tool_name}")

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/SAGAAIDEV/mcp-ahrefs'

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