Skip to main content
Glama
islobodan

Crucher MCP

get_constant

Read-onlyIdempotent

Retrieve a mathematical, physical, or chemical constant by selecting from a predefined list of common values like pi, e, or the speed of light.

Instructions

Returns a mathematical, physical, or chemical constant. See enum values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • The tool schema/definition for get_constant, including its inputSchema with an enum of constant names (pi, e, tau, phi, etc.) and required parameter 'name'.
    {
        name: "get_constant",
        annotations: {
            title: "Get Constant",
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false,
        },
        description:
            "Returns a mathematical, physical, or chemical constant. See enum values.",
        inputSchema: {
            type: "object",
            properties: {
                name: {
                    type: "string",
                    enum: [
                        "pi",
                        "e",
                        "tau",
                        "phi",
                        "sqrt2",
                        "euler_mascheroni",
                        "c",
                        "g",
                        "G",
                        "h",
                        "k",
                        "R",
                        "NA",
                        "e_charge",
                        "m_e",
                        "m_p",
                    ],
                },
            },
            required: ["name"],
        },
  • The handler function for the get_constant tool. Looks up the constant name in the CONSTANTS object and returns its value, or throws if unknown.
    get_constant: ({ name }) => {
        if (name in CONSTANTS) return CONSTANTS[name];
        throw new Error(`Unknown constant: ${name}`);
    },
  • The CONSTANTS object shared between get_constant and evaluate_expression, containing mathematical (pi, e, tau, phi, sqrt2, euler_mascheroni) and physical/chemical (c, g, G, h, k, R, NA, e_charge, m_e, m_p) constants with their values.
    const CONSTANTS = {
        // Math
        pi: Math.PI,
        e: Math.E,
        tau: 2 * Math.PI,
        phi: 1.618033988749895,
        sqrt2: Math.SQRT2,
        euler_mascheroni: 0.5772156649015329,
        // Physics (SI Units)
        c: 299792458,
        g: 9.80665,
        G: 6.6743e-11,
        h: 6.62607015e-34,
        k: 1.380649e-23,
        R: 8.314462618,
        NA: 6.02214076e23,
        e_charge: 1.602176634e-19,
        m_e: 9.1093837015e-31,
        m_p: 1.67262192369e-27,
    };
  • cruncher.js:130-145 (registration)
    Registration of get_constant in the MAIN_THREAD_TOOLS set, meaning it runs directly on the main thread without worker overhead for performance.
    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)
Behavior3/5

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

Annotations already provide readOnlyHint, idempotentHint, and destructiveHint=false. The description adds no further behavioral context beyond stating the return type. No contradiction.

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?

A single sentence that efficiently conveys the tool's purpose. No unnecessary words or repetition.

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?

For a simple constant lookup tool with one enum parameter and no output schema, the description is complete and sufficient. It covers the purpose and how to specify the constant.

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 single parameter 'name' has a full enum in the schema, and the description directs to those enum values. With 0% schema description coverage, the description adds minimal value but is adequate.

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 clearly states the tool returns a constant (mathematical, physical, or chemical) and references the enum values, distinguishing it from sibling tools like convert_unit or evaluate_expression.

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?

The description implies usage for constant lookups but lacks explicit guidance on when to use versus other math tools or when not to use. It does not mention alternatives or preconditions.

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