Skip to main content
Glama
NimbleBrainInc

MCP Echo Service

echo_message

Echo back messages with optional uppercase formatting to test MCP protocol functionality and verify communication channels.

Instructions

Echo back a message with optional formatting.

Args: message: The message to echo back uppercase: Whether to convert the message to uppercase ctx: MCP context

Returns: Complete echo response with metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYes
uppercaseNo

Implementation Reference

  • The main handler function for the `echo_message` tool.
    async def echo_message(
        message: str, uppercase: bool = False, ctx: Context | None = None
    ) -> EchoMessageResponse:
        """Echo back a message with optional formatting.
    
        Args:
            message: The message to echo back
            uppercase: Whether to convert the message to uppercase
            ctx: MCP context
    
        Returns:
            Complete echo response with metadata
        """
        if ctx:
            await ctx.info(f"Echoing message (uppercase={uppercase}): {message[:50]}...")
    
        result_message = message.upper() if uppercase else message
    
        return EchoMessageResponse(
            original_message=message,
            echoed_message=result_message,
            uppercase_applied=uppercase,
            message_length=len(message),
            timestamp=datetime.now(UTC).isoformat(),
        )
  • Registration of the `echo_message` tool using the `@mcp.tool()` decorator.
    @mcp.tool()
  • Response schema definition for the `echo_message` tool.
    class EchoMessageResponse(BaseModel):
        """Response model for echo_message tool."""
    
        original_message: str = Field(..., description="The original message sent")
        echoed_message: str = Field(..., description="The echoed message (possibly transformed)")
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/NimbleBrainInc/mcp-echo'

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