Skip to main content
Glama
islobodan

Crucher MCP

std_dev

Read-onlyIdempotent

Calculate standard deviation for a list of numbers. Choose sample (n-1) or population (n) via population parameter.

Instructions

Sample standard deviation (n-1). Set population: true for population (n).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numbersYes
populationNo

Implementation Reference

  • The std_dev handler function. Computes the standard deviation by taking the square root of the variance (computed via computeVariance helper). Accepts 'numbers' array and optional 'population' boolean (default sample n-1).
    std_dev: ({ numbers, population }) => Math.sqrt(computeVariance(numbers, !!population)),
  • The computeVariance helper function used by std_dev. Computes sample variance (n-1) by default, or population variance (n) when population=true.
    function computeVariance(numbers, population) {
        if (numbers.length === 0)
            throw new Error("Cannot calculate the variance of an empty list.");
        if (numbers.length === 1 && !population)
            throw new Error("Sample variance needs ≥2 values. Use population: true.");
        const mean = numbers.reduce((a, b) => a + b, 0) / numbers.length;
        const ss = numbers.reduce((a, b) => a + (b - mean) ** 2, 0);
        return ss / (population ? numbers.length : numbers.length - 1);
    }
  • The schema definition for std_dev tool. Defines input: 'numbers' array (required) and 'population' boolean (optional).
    {
        name: "std_dev",
        annotations: {
            title: "Standard Deviation",
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false,
        },
        description:
            "Sample standard deviation (n-1). Set population: true for population (n).",
        inputSchema: {
            type: "object",
            properties: {
                numbers: { type: "array", items: { type: "number" } },
                population: { type: "boolean" },
            },
            required: ["numbers"],
        },
    },
  • cruncher.js:82-84 (registration)
    std_dev is registered in the 'standard' tool set tier, making it available in standard and full modes.
    "sum", "avg", "min", "max", "count", "variance", "std_dev",
    "percentage_of", "percentage_change", "percentage_reverse",
    "median", "range",
  • cruncher.js:144-145 (registration)
    std_dev is listed as a MAIN_THREAD_TOOLS, meaning it executes directly on the main thread (no worker overhead) for fast execution.
    "count", "min", "max", "variance", "std_dev",
    // Percentage
Behavior4/5

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

Annotations declare read-only and idempotent; description adds the specific calculation details (n-1 vs n), which is transparent beyond 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?

Two sentences, no wasted words, front-loaded with purpose. Highly concise and clear.

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

Completeness4/5

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

Given no output schema, description omits return type but for a math function it is implicitly a number. Adequate for the context.

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?

With 0% schema coverage, description explains the population parameter but does not describe the numbers parameter beyond implication. Adds partial meaning.

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?

Description explicitly states 'Sample standard deviation (n-1)' and mentions population variant, clearly identifying the tool's purpose and distinguishing it from siblings like variance.

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

Usage Guidelines4/5

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

Provides guidance on when to use sample vs population via the population parameter, but does not explicitly compare to sibling tools like variance or avg.

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