Skip to main content
Glama
KrishnaPapana

MCP Server Deepdive

add_two_numbers

Calculate the sum of two numbers by providing both values as inputs to get the total result.

Instructions

Adds two numbers together.
Args:
a -- the first number
b -- the second number
Returns:
The sum of a and b 

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • The handler function for the 'add_two_numbers' tool, which adds two input numbers and returns their sum.
    def add_two_numbers(a, b):
        """
        Adds two numbers together.
        Args:
        a -- the first number
        b -- the second number
        Returns:
        The sum of a and b 
        """
        
        return a + b
  • The @mcp.tool() decorator registers the add_two_numbers function as an MCP tool.
    @mcp.tool()
  • Docstring providing the schema description for parameters 'a', 'b' and the return value.
    """
    Adds two numbers together.
    Args:
    a -- the first number
    b -- the second number
    Returns:
    The sum of a and b 
    """
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/KrishnaPapana/mcpserverexample'

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