Skip to main content
Glama
YuheiNakasaka

Arithmetic MCP Server

subtract

Calculate the difference between two numbers by subtracting one from another. This arithmetic tool helps solve subtraction problems quickly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Implementation Reference

  • Handler function for the 'subtract' tool. It takes two numbers a and b, computes a - b, and returns a text content with the result in Japanese.
    async ({ a, b }) => ({ content: [{ type: "text", text: `${a} と ${b} の引き算の結果: ${a - b}` }] })
  • Zod schema defining input parameters for the 'subtract' tool: two numbers 'a' and 'b'.
    { a: z.number(), b: z.number() },
  • src/index.ts:25-34 (registration)
    Registration of the 'subtract' tool using McpServer's tool method, specifying name, input schema, and handler function.
    server.tool( "subtract", { a: z.number(), b: z.number() }, async ({ a, b }) => ({ content: [{ type: "text", text: `${a} と ${b} の引き算の結果: ${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/YuheiNakasaka/arithmetic-mcp-server'

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