Skip to main content
Glama
islobodan

Crucher MCP

max

Read-onlyIdempotent

Calculate the maximum value from an array of numbers.

Instructions

Maximum of numbers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numbersYes

Implementation Reference

  • The 'max' tool schema definition, including its name, annotations, description, and inputSchema (accepts an array of 'numbers').
    {
        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"],
        },
    },
  • The 'max' tool handler function that computes the maximum of an array of numbers using Math.max(). Throws if the array is empty.
    max: ({ numbers }) => {
        if (numbers.length === 0)
            throw new Error("Cannot find the maximum of an empty list.");
        return Math.max(...numbers);
    },
  • cruncher.js:130-149 (registration)
    MAIN_THREAD_TOOLS set that includes 'max', indicating it runs on the main thread (no worker overhead).
    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",
    ]);
  • cruncher.js:76-80 (registration)
    TOOL_TIERS.standard array lists 'max' as part of the standard tool set (34 tools).
        "sum", "avg", "min", "max", "count", "variance", "std_dev",
        "percentage_of", "percentage_change", "percentage_reverse",
        "median", "range",
        "convert_unit",
    ],
  • Regex RE_FUNC_MAX_FUNC used in evaluate_expression to replace max() calls with Math.max().
    const RE_SCIENTIFIC_NOTATION = /(\d+\.?\d*)e([+-]?\d+)/gi;
    const RE_FUNC_ABS           = /\babs\s*\(/g;
    const RE_FUNC_ROUND         = /\bround\s*\(/g;
    const RE_FUNC_FLOOR         = /\bfloor\s*\(/g;
    const RE_FUNC_CEIL          = /\bceil\s*\(/g;
    const RE_FUNC_MIN_FUNC      = /\bmin\s*\(/g;
    const RE_FUNC_MAX_FUNC      = /\bmax\s*\(/g;
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, which indicate safe, read-only behavior. The description adds no further behavioral details (e.g., behavior on empty array). It does not contradict annotations.

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?

Extremely concise at 4 words. Every word earns its place. Front-loaded and no waste.

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

Completeness5/5

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

Given the simplicity of the tool (one parameter, no output schema, comprehensive annotations), the description is sufficient. No additional context needed.

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?

The input schema has one parameter 'numbers' (array of numbers). Description does not add any meaning beyond the schema; schema coverage is 0%. No compensation for low coverage.

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' clearly states the tool computes the maximum value among numbers. It uses a specific verb ('compute') implicitly and the resource 'maximum' is unambiguous. Among siblings like min, sum, avg, it is easily distinguishable.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives like min or average. The purpose is clear but there is no mention of exclusions or specific contexts. Usage is implied from the name and description.

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