Skip to main content
Glama

add

Calculate the sum of two numbers by providing both values as input parameters.

Instructions

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

Input Schema

NameRequiredDescriptionDefault
aYes
bYes

Input Schema (JSON Schema)

{ "properties": { "a": { "title": "A", "type": "number" }, "b": { "title": "B", "type": "number" } }, "required": [ "a", "b" ], "type": "object" }

Implementation Reference

  • server.py:27-38 (handler)
    The handler function for the 'add' tool. It takes two float arguments 'a' and 'b' and returns their sum.
    def add(a: float, b: float) -> float: """ Add two numbers together. Args: a: The first number b: The second number Returns: The sum of a and b """ return a + b
  • server.py:26-26 (registration)
    The @mcp.tool() decorator registers the 'add' function as an MCP tool.
    @mcp.tool()
  • Type signature defining input parameters a and b as floats, and return type as float, along with docstring describing the schema.
    def add(a: float, b: float) -> float:

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/xiaoyuchenhot/MCP-example'

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