Skip to main content
Glama

subtract

Perform subtraction by subtracting the subtrahend from the minuend using the Math-MCP server. Input two numbers to get the accurate result of the operation.

Instructions

Subtracts the second number from the first number

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
minuendYesThe number to subtract from (minuend)
subtrahendYesThe number being subtracted (subtrahend)

Implementation Reference

  • The core handler function that executes the subtraction logic: minuend - subtrahend.
    static subtract(minuend: number, subtrahend: number) { const difference = minuend - subtrahend return difference }
  • Zod input schema for the 'subtract' tool defining the two number parameters.
    minuend: z.number().describe("The number to subtract from (minuend)"), subtrahend: z.number().describe("The number being subtracted (subtrahend)")
  • src/index.ts:44-56 (registration)
    Registration of the 'subtract' tool on the MCP server, including schema and wrapper handler.
    mathServer.tool("subtract", "Subtracts the second number from the first number", { minuend: z.number().describe("The number to subtract from (minuend)"), subtrahend: z.number().describe("The number being subtracted (subtrahend)") }, async ({ minuend, subtrahend }) => { const value = Arithmetic.subtract(minuend, subtrahend) return { content: [{ type: "text", text: `${value}` }] } })

Other Tools

Related 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/EthanHenrickson/math-mcp'

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