Skip to main content
Glama
islobodan

Crucher MCP

natural_log

Read-onlyIdempotent

Compute the natural logarithm (ln) for positive numeric values. Rejects non-positive inputs with an error.

Instructions

Natural logarithm (ln). Errors on non-positive input.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYes

Implementation Reference

  • The natural_log handler function. Uses Math.log(value) to compute the natural logarithm (base e). Throws an error for non-positive input.
    /**
     * Calculates the natural logarithm (base-e) of a value.
     * @param {Object} args - The arguments object.
     * @param {number} args.value - The positive number.
     * @returns {number} The natural logarithm of value.
     * @throws {Error} If value is not positive.
     */
    natural_log: ({ value }) => {
        if (value <= 0)
            throw new Error(
                "Natural log is only defined for positive numbers.",
            );
        return Math.log(value);
    },
  • The input schema definition for natural_log. Defines a single required 'value' parameter of type number.
    {
        name: "natural_log",
        annotations: {
            title: "Natural Logarithm",
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false,
        },
        description:
            "Natural logarithm (ln). Errors on non-positive input.",
        inputSchema: {
            type: "object",
            properties: { value: { type: "number" } },
            required: ["value"],
        },
    },
  • cruncher.js:69-73 (registration)
    The natural_log tool is registered in the 'standard' tool tier set (line 73), making it available in the default tool set.
    standard: [
        "evaluate_expression",
        "add", "subtract", "multiply", "divide",
        "sqrt", "power", "absolute", "modulo", "factorial",
        "logarithm", "natural_log", "get_constant",
  • natural_log is listed in MAIN_THREAD_TOOLS (line 142) so it executes directly on the main thread without spawning a worker.
    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",
    ]);
Behavior4/5

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

Annotations already indicate read-only, non-destructive, idempotent behavior. The description adds the critical error condition for non-positive input, which is a key behavioral trait. This complements the annotations well.

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 two short sentences, each serving a purpose: stating the function and noting the error condition. It is front-loaded and contains no fluff.

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 mathematical function with one parameter and annotations provided, the description adequately covers purpose, constraints, and error behavior. No additional detail is needed given the context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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 'value' parameter, but the function name and context make it clear that the parameter represents the number to take the log of. The description implicitly covers the semantic 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?

The description explicitly states it computes the natural logarithm (ln) and highlights the error condition for non-positive input. This clearly distinguishes it from sibling tools like 'logarithm' which might use a different base.

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 computing natural logs and includes a constraint (no non-positive input), but does not explicitly guide when to choose this tool over alternatives like 'logarithm' or 'sqrt'.

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