Skip to main content
Glama
islobodan

Crucher MCP

max

Read-onlyIdempotent

Computes the maximum value from a list of numbers. Returns the highest number to identify the peak in a dataset.

Instructions

Maximum of numbers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numbersYes

Implementation Reference

  • The handler function that executes the 'max' tool logic. It iterates through the numbers array to find the maximum value, throwing an error if the array is empty.
    max: ({ numbers }) => {
        if (numbers.length === 0)
            throw new Error("Cannot find the maximum of an empty list.");
        let maxVal = -Infinity;
        for (let i = 0; i < numbers.length; i++) {
            if (numbers[i] > maxVal) maxVal = numbers[i];
        }
        return maxVal;
    },
  • The input schema for the 'max' tool, defining its name, description, annotations, and input validation (requires a 'numbers' array of type number).
    {
        name: "max",
        annotations: {
            title: "Maximum",
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false,
        },
        description: "Maximum of numbers.",
        inputSchema: {
            type: "object",
            properties: {
                numbers: { type: "array", items: { type: "number" } },
            },
            required: ["numbers"],
        },
    },
  • cruncher.js:136-155 (registration)
    The 'max' tool is registered as a MAIN_THREAD_TOOL (line 144), meaning it runs on the main thread without worker overhead. It is also included in the 'standard' tool tier (line 82).
    const MAIN_THREAD_TOOLS = new Set([
        // Angle management
        "set_angle_mode", "get_angle_mode",
        // Trigonometry (instant Math calls)
        "sine", "cosine", "tangent", "asin", "acos", "atan",
        // Cache management
        "cache_clear", "cache_info",
        // Simple stats (zero-cost)
        "count", "min", "max", "variance", "std_dev",
        // Percentage
        "percentage_of", "percentage_change", "percentage_reverse",
        // Math one-liners
        "power", "sqrt", "logarithm", "natural_log", "absolute",
        // Constant lookup
        "get_constant",
        // Memory recall (single variable read)
        "memory_recall",
        // Unit conversion
        "convert_unit",
    ]);
  • Pre-compiled regex RE_FUNC_MAX_FUNC used in evaluate_expression to convert max() calls to Math.max() in expression strings.
    const RE_FUNC_MIN_FUNC      = /\bmin\s*\(/g;
    const RE_FUNC_MAX_FUNC      = /\bmax\s*\(/g;
    // Trigonometric functions (radians only — same as standard math)
Behavior3/5

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

Annotations already indicate readOnlyHint=true, destructiveHint=false, and idempotentHint=true, covering safety and idempotency. The description adds no additional behavioral context beyond this, such as behavior on empty input or performance implications.

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 concise sentence with no superfluous words. It is appropriately front-loaded and efficient for a simple mathematical tool.

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 simplicity (one parameter, no output schema), the description is adequate but incomplete. It implicitly states the return value (maximum number) but does not explicitly describe the output or handle edge cases like an empty array.

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 input schema has 0% description coverage for the 'numbers' parameter. The description 'Maximum of numbers.' implies that the parameter is a list of numbers, adding minimal meaning beyond the schema. However, it does not explain format requirements (e.g., minimum length) or handling of non-numbers.

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

Purpose5/5

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

The description 'Maximum of numbers.' explicitly states the verb ('Maximum') and resource ('numbers'), clearly distinguishing it from sibling tools like 'min' and 'avg'. It is both specific and unambiguous.

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 is provided on when to use this tool versus alternatives such as 'min' or 'avg'. There is no mention of use cases, edge cases (e.g., empty array), or prerequisites.

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