Skip to main content
Glama
sakthigcp

MCP Server Example

by sakthigcp

add

Calculate the sum of two integer values to perform basic arithmetic operations and obtain accurate mathematical results.

Instructions

Adds two numbers a and b and returns the result!

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • The handler function that implements the 'add' tool logic, adding two integers and returning the sum.
    def add(a: int, b: int) -> int: """ Adds two numbers a and b and returns the result! """ return a + b
  • The decorator that registers the 'add' function as an MCP tool.
    @mcp.tool()
  • Type annotations defining the input schema (two integers) and output (integer). The docstring provides additional description.
    def add(a: int, b: int) -> int:

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/sakthigcp/mcpserverexample'

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