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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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}")
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool will be 'automatically decorated with SAAGA decorators for exception handling and logging,' which adds useful context about error handling. However, it doesn't disclose performance characteristics, rate limits, or other behavioral traits beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and well-structured with clear sections (purpose, context, args, returns). Every sentence earns its place, though the SAAGA decorator explanation could be considered slightly extraneous for a simple tool description. It's front-loaded with the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (single parameter, no annotations, but has output schema), the description is reasonably complete. It explains what the tool does, documents the parameter, and describes the return value. The output schema existence means the description doesn't need to fully explain return values, but it still provides helpful context about the prefix addition.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It explicitly documents the single parameter ('message: The message to echo back') and provides return value information ('The echoed message with a prefix'), adding meaningful semantics beyond what the bare schema provides. This adequately compensates for the lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('echo back') and resource ('input message'), distinguishing it from siblings like 'calculate_fibonacci' or 'get_time' which perform different operations. The first sentence directly explains what the tool does without being tautological.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'simulate_heavy_computation' or 'process_batch_data'. It only mentions it's a 'simple example tool' but doesn't specify appropriate use cases or exclusions, leaving the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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