Skip to main content
Glama
islobodan

Crucher MCP

acos

Read-onlyIdempotent

Compute the arccosine of a number to get the angle in degrees, or use unit parameter for radians.

Instructions

Arccosine. Result in degrees by default, or radians with unit param.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYes
unitNo

Implementation Reference

  • The acos tool handler: computes arccosine of a value between -1 and 1, returning result in degrees (default) or radians based on the unit parameter. Uses Math.acos() and fromRadians() helper.
    /**
     * Calculates the inverse cosine (arccosine) of a value.
     * @param {Object} args - The arguments object.
     * @param {number} args.value - The value between -1 and 1.
     * @param {string} [args.unit] - The unit ("degrees" or "radians").
     * @returns {number} The angle whose cosine is value.
     * @throws {Error} If value is not between -1 and 1.
     */
    acos: ({ value, unit }) => {
        if (value < -1 || value > 1)
            throw new Error("acos input must be between -1 and 1.");
        return fromRadians(Math.acos(value), unit);
    },
  • The acos tool schema definition (inputSchema): accepts a 'value' (number, required) and an optional 'unit' (string, enum: degrees/radians).
    {
        name: "acos",
        annotations: {
            title: "Arccosine",
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false,
        },
        description:
            'Arccosine. Result in degrees by default, or radians with unit param.',
        inputSchema: {
            type: "object",
            properties: {
                value: { type: "number" },
                unit: { type: "string", enum: ["degrees", "radians"] },
            },
            required: ["value"],
        },
    },
  • cruncher.js:75-86 (registration)
    The acos tool is registered in the 'standard' tool tier within TOOL_TIERS configuration, ensuring it is exposed to the LLM.
    standard: [
        "evaluate_expression",
        "add", "subtract", "multiply", "divide",
        "sqrt", "power", "absolute", "modulo", "factorial",
        "logarithm", "natural_log", "get_constant",
        "sine", "cosine", "tangent", "asin", "acos", "atan",
        "set_angle_mode", "get_angle_mode",
        "sum", "avg", "min", "max", "count", "variance", "std_dev",
        "percentage_of", "percentage_change", "percentage_reverse",
        "median", "range",
        "convert_unit",
    ],
  • The fromRadians helper used by the acos handler to convert the radian result of Math.acos() into degrees (default) or keep it in radians.
    const fromRadians = (radians, unit) => {
        const resolved = unit || angleMode;
        return resolved === "degrees" ? radians * (180 / Math.PI) : radians;
    };
  • Pre-compiled regex RE_FUNC_ACOS used by evaluate_expression to convert 'acos(...)' to 'Math.acos(...)' in expressions.
    const RE_FUNC_ACOS          = /\bacos\s*\(/g;
    const RE_FUNC_ATAN          = /\batan\s*\(/g;
Behavior4/5

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

Annotations already indicate readOnly, non-destructive, idempotent behavior. Description adds value by disclosing default unit (degrees) and how to change it via the unit parameter. However, it doesn't mention input domain constraints (value must be in [-1,1] for real output).

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, front-loaded with the core function ('Arccosine'). No wasted words; every sentence contributes meaning.

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?

For a simple 2-param tool with no output schema, description is mostly complete. It covers purpose and unit behavior. Minor gap: missing mention of valid input range for arccosine (-1 to 1).

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?

Schema coverage is 0%, so description must compensate. It explains the unit parameter's effect but does not clarify that 'value' is the cosine input (range implied). Partial compensation; not fully descriptive of both parameters.

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 clearly states 'Arccosine' and specifies result units (degrees by default, radians with unit param). This distinctively identifies the tool among siblings like sine, cosine, arctan.

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?

Description does not provide explicit guidance on when to use this tool versus alternatives (e.g., arctan). It only implies usage as the inverse cosine function, leaving selection context to the agent.

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