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}`
            }]
        }
    })
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('subtracts') but does not cover important traits such as error handling (e.g., for non-numeric inputs), performance characteristics, or return format. This is a significant gap for a tool with no annotation coverage, making it minimally informative beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without any unnecessary words. It is front-loaded and wastes no space, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (simple arithmetic), high schema coverage (100%), and lack of output schema, the description is adequate but incomplete. It covers the basic operation but fails to address behavioral aspects like error handling or result format, which are important for an agent to use it correctly without annotations. This results in a minimal viable score.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with clear descriptions for both parameters ('minuend' and 'subtrahend'). The description adds no additional meaning beyond what the schema provides, as it only restates the subtraction operation without detailing parameter usage or constraints. This meets the baseline score when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('subtracts') and identifies the resources involved ('the second number from the first number'). It distinguishes this from sibling tools like 'add' or 'multiply' by specifying subtraction. However, it doesn't explicitly name the sibling alternatives or contrast with them directly, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'add' or 'sum', nor does it mention any prerequisites or exclusions. It implies usage for subtraction operations but lacks explicit context for selection among the many mathematical sibling tools, leaving the agent to infer based on the operation name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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