Skip to main content
Glama
mathmethods-mcp

mathmethods-mcp

integral_trapecio

Approximates a definite integral using the composite trapezoidal rule and returns error estimates plus an optional plot.

Instructions

Approximate ∫ₐᵇ f(x) dx with the composite trapezoidal rule.

Args: func_str: Math expression in x. a, b: Integration limits (b > a). n: Number of subintervals. epsilon: Optional point in [a, b] for the truncation error bound. precision: Rounding digits. plot: When True, also return a PNG plot of f(x) over [a, b].

Returns: Dict with the integral, error estimates and table. With plot=True a list [dict, Image] is returned instead.

Input Schema

NameRequiredDescriptionDefault
aYes
bYes
nYes
plotNo
epsilonNo
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?

No annotations exist, so the description carries the full burden, and it does disclose meaningful behavior: the return type changes to a list [dict, Image] when plot=True, error estimates are returned, and epsilon enables a truncation-error bound. It does not state error/exception behavior or the exact dict keys, keeping it short of a 5.

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?

Front-loaded one-line summary followed by Args and Returns sections, with no filler. Every line earns its place by documenting a distinct parameter or the return contract.

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?

With no output schema and no annotations, the description supplies the return structure (integral, error estimates, table) and the conditional plot return, which is enough to call the tool correctly. The exact key names and table schema remain unspecified, so it is not fully exhaustive, but it is close to complete for a deterministic computation tool.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate and it does: every one of the 7 parameters is explained, including the b>a constraint, n as subinterval count, epsilon as an optional point in [a,b] for the error bound, precision as rounding digits, and plot's effect on the result. This is exactly the added meaning the bare schema lacks.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb+resource: 'Approximate ∫ₐᵇ f(x) dx with the composite trapezoidal rule.' An agent immediately knows it is a numerical quadrature tool. However, it never distinguishes itself from siblings like integral_simpson13, integral_simpson38, or integral_rectangulo, which are near-identical integration tools differing only in method.

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?

Usage is only implied by the mathematical framing ('composite trapezoidal rule'); there is no explicit statement of when to prefer trapezoid over Simpson or rectangle rules, and no mention of alternatives among the many integral_* siblings. The required inputs (func_str, a<b, n) hint at intended use but no selection guidance is given.

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