Skip to main content
Glama
mathmethods-mcp

mathmethods-mcp

integral_rectangulo

Compute definite integrals numerically using the composite midpoint (rectangle) rule from a math expression, limits, and subinterval count; optionally return error estimates and a plot.

Instructions

Approximate ∫ₐᵇ f(x) dx with the composite midpoint (rectangle) 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

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose the return shape (dict with integral, error estimates and table, or a [dict, Image] list when plot=True). That is meaningful behavioral context, but it omits error/exception behavior, precision-dependent output details, and cost characteristics.

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?

Purpose is front-loaded in one sentence, followed by tight Args and Returns sections with zero filler. The size is well matched to a seven-parameter tool.

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 tool with no output schema and no annotations, the description supplies both the parameter meanings and the conditional return format, which is largely sufficient. The missing piece is integration-specific behavioral detail such as accuracy caveats or failure modes.

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 its Args block documents all seven parameters including the non-obvious ones (epsilon as an optional truncation-error point in [a,b], precision as rounding digits, plot toggling a PNG). epsilon's semantics remain slightly obscure, keeping it from a 5.

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?

States a specific verb (approximate the integral) and the exact method (composite midpoint/rectangle rule), which naturally distinguishes it from the Simpson and trapezoid siblings. It never names an alternative explicitly, so sibling differentiation is left to the reader's knowledge of the method names.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to choose the rectangle rule over integral_trapecio, integral_simpson13, integral_simpson38, or integral_comparar, nor any note on accuracy tradeoffs or prerequisites. The only usage-flavored text is a per-parameter note on epsilon, which concerns the argument, not tool selection.

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