Skip to main content
Glama
tech-sushant

Calculator MCP Server

by tech-sushant

subtract

Calculate the difference between two numbers by subtracting the second value from the first. Use this tool to perform subtraction operations and find numerical differences.

Instructions

Subtract second number from first number

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesNumber to subtract from
bYesNumber to subtract

Implementation Reference

  • Handler for the 'subtract' tool: extracts 'a' and 'b' from arguments, computes a - b, and returns formatted result as text content.
    case "subtract": { const { a, b } = args as { a: number; b: number }; const result = a - b; return { content: [ { type: "text", text: `${a} - ${b} = ${result}`, }, ], }; }
  • Input schema for 'subtract' tool defining parameters 'a' (number to subtract from) and 'b' (number to subtract), both required.
    inputSchema: { type: "object", properties: { a: { type: "number", description: "Number to subtract from", }, b: { type: "number", description: "Number to subtract", }, }, required: ["a", "b"], },
  • src/index.ts:38-55 (registration)
    Registration of the 'subtract' tool in the list of tools, including name, description, and input schema.
    { name: "subtract", description: "Subtract second number from first number", inputSchema: { type: "object", properties: { a: { type: "number", description: "Number to subtract from", }, b: { type: "number", description: "Number to subtract", }, }, required: ["a", "b"], }, },

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/tech-sushant/calculator-mcp'

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