Skip to main content
Glama

add

Calculate the sum of two integer values to perform basic arithmetic operations within the MCP Test MCP server environment.

Instructions

Add two numbers together.

Args: a: First number b: Second number

Returns: The sum of a and b

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • Primary handler function for the 'add' MCP tool. Adds two integers a and b, logs the call, and returns the sum. Registered via @mcp.tool() decorator.
    @mcp.tool() def add(a: int, b: int) -> int: """ Add two numbers together. Args: a: First number b: Second number Returns: The sum of a and b """ logger.debug(f"Add tool called: {a} + {b}") return a + b
  • Mock handler for the 'add' tool in pytest fixtures. Used for testing without the full server. Simple addition without logging.
    @mcp.tool() async def add(a: int, b: int) -> int: """Add two integer numbers together. Args: a: First number b: Second number Returns: Sum of a and b """ return a + b

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/rdwj/mcp-test-mcp'

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