Skip to main content
Glama
mathmethods-mcp

mathmethods-mcp

finite_differences

Approximate first and second derivatives of f(x) at a point using forward, backward, and central finite differences, then compare them with exact SymPy derivatives and errors.

Instructions

Approximate the first and second derivatives of f(x) at x with finite differences.

Computes forward, backward and central differences for the first derivative, plus the central second derivative, and compares each against the exact derivative from SymPy.

Args: func_str: Math expression in x. x_val: Point where the derivative is evaluated. h: Step size (small, positive). precision: Rounding digits. plot: When True, also return a PNG of f(x) and its exact tangent.

Returns: Dict with the exact and numerical derivatives and their errors. With plot=True a list [dict, Image] is returned instead.

Input Schema

NameRequiredDescriptionDefault
hNo
plotNo
x_valYes
func_strYes
precisionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.1
    • addedInput schema / properties / plot
      Added value: +{
      +  "default": false,
      +  "title": "Plot",
      +  "type": "boolean"
      +}
  2. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden, and it does disclose the return shape and the plot side effect (list [dict, Image] instead of a dict) that an agent could not otherwise infer since there is no output schema. It also flags the h constraint (small, positive). What it omits is failure behavior — invalid expression strings, h collapsing to zero, or non-differentiable points — but the return-format disclosure is genuinely valuable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in the first sentence, followed by an efficient method summary and a conventional Args/Returns block. The method-enumeration sentence is slightly redundant with the opening sentence, but overall the structure is clean and every line contributes information the schema does not carry.

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 five-parameter computation tool with no annotations, no output schema, and 0% schema coverage, the description supplies both parameter meanings and the return contract, including the plot variant. It is nearly complete; only edge-case behavior (invalid input, h too small, plotting failures) is left unaddressed.

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?

Schema description coverage is 0%, so the description must compensate, and it does: all five parameters are explained in the Args block. h is characterized beyond its type ('step size, small, positive'), which is the most semantically important parameter here, and precision is described as rounding digits. It falls short of 5 because the expected syntax of func_str (e.g. SymPy-style 'x**2') and the plotting dependency are not stated.

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 opening sentence names a specific verb (approximate) and resource (first and second derivatives of f(x) at x) with a named method (finite differences), then enumerates the concrete variants computed: forward, backward, central, and central second derivative. This clearly separates it from siblings like root_newton_raphson, integral_simpson13, and the ode_* family.

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 its use case (numerical differentiation compared against the exact SymPy derivative, i.e. a teaching/error-analysis tool), which gives the agent context about when it is appropriate. However, there is no explicit when-to-use guidance, no statement of when a sibling should be preferred, and no prerequisites (e.g. the function must be differentiable, h must be positive and small).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.