Skip to main content
Glama
islobodan

Crucher MCP

sum

Read-onlyIdempotent

Calculate the sum of a list of numbers. Provide an array of numbers to get their total.

Instructions

Sum of numbers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numbersYes

Implementation Reference

  • Schema definition for the 'sum' tool. Defines name, description, and inputSchema expecting an array of numbers.
    {
        name: "sum",
        annotations: {
            title: "Sum",
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false,
        },
        description: "Sum of numbers.",
        inputSchema: {
            type: "object",
            properties: {
                numbers: { type: "array", items: { type: "number" } },
            },
            required: ["numbers"],
        },
    },
  • cruncher.js:76-76 (registration)
    The tool name 'sum' is listed in the standard tool tier, registering it as an available tool.
    "sum", "avg", "min", "max", "count", "variance", "std_dev",
  • Handler function for the 'sum' tool. Uses reduce with safeMath.add to sum an array of numbers.
    sum: ({ numbers }) =>
        numbers.reduce((acc, val) => safeMath.add(acc, val), 0),
  • safeMath.add helper used by the sum handler to perform floating-point-safe addition.
    add: (a, b) => {
        const d1 = countDecimals(a);
        const d2 = countDecimals(b);
        const maxDecimals = Math.max(d1, d2);
        const multiplier = Math.pow(10, maxDecimals);
        return (
            (Math.round(a * multiplier) + Math.round(b * multiplier)) /
            multiplier
        );
    },
Behavior2/5

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

Annotations already declare readOnlyHint, destructiveHint, idempotentHint. The description adds no behavioral traits beyond that, omitting details like return type or empty array handling. No contradiction with annotations.

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

Conciseness2/5

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

Extremely brief ('Sum of numbers.') but under-specifies; fails to earn its place by omitting critical invocation details. Conciseness should not come at the cost of completeness.

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

Completeness2/5

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

Missing essential context for a simple tool: no return value description, no mention of behavior for empty arrays or non-numeric values. Despite no output schema, the description should cover basic usage.

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

Parameters2/5

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

With 0% schema description coverage, the description should compensate but only restates the parameter name without adding constraints or meaning (e.g., 'all numbers to sum'). The schema alone defines the type, so additional clarity is minimal.

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 'Sum of numbers' clearly indicates the tool computes a sum, with 'of numbers' clarifying it operates on an array. It distinguishes from siblings like 'add' (likely binary addition) by implying a list. However, it could be more explicit about the array nature.

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?

No guidance on when to use this tool versus alternatives such as 'add' or 'multiply'. No mention of applicable contexts or exclusions, e.g., empty arrays or non-finite numbers.

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

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/islobodan/cruncher-mcp'

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