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 value. 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

  • The switch case handler for the 'subtract' tool. It extracts parameters 'a' and 'b', computes 'a - b', and returns a text response with the formatted result.
    case "subtract": { const { a, b } = args as { a: number; b: number }; const result = a - b; return { content: [ { type: "text", text: `${a} - ${b} = ${result}`, }, ], }; }
  • src/index.ts:38-55 (registration)
    The registration of the 'subtract' tool in the list of available tools, including its name, description, and input schema definition.
    { 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"], }, },
  • The input schema for the '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"], },
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/tech-sushant/calculator-mcp'

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