Skip to main content
Glama
mathmethods-mcp

mathmethods-mcp

root_bisection

Finds a root of f(x)=0 within an interval using the bisection method, requiring opposite endpoint signs and returning convergence details.

Instructions

Find a root of f(x) = 0 in [a, b] using the bisection method.

Requires f(a) and f(b) to have opposite signs (Bolzano's theorem).

Args: func_str: Math expression in x, e.g. "x**2 - 4". a: Left endpoint of the interval. b: Right endpoint of the interval (must be > a). tol: Convergence tolerance on the residual/error. max_iter: Maximum number of iterations. precision: Rounding digits for the reported root. plot: When True, also return a PNG plot of f(x) and the root.

Returns: Dict with the root, convergence flag, iteration table and errors. With plot=True a list [dict, Image] is returned instead.

Input Schema

NameRequiredDescriptionDefault
aYes
bYes
tolNo
plotNo
func_strYes
max_iterNo
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.3/5.0
Behavior4/5

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

With no annotations, the description carries the burden well: it discloses the convergence flag, iteration table, error information, and the polymorphic return shape when plot=True. It omits what happens on failure (e.g., same-sign endpoints raising an error vs returning a flag) and any cost/iteration-cap behavior.

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?

Front-loaded one-line purpose followed by precondition, then clean Args/Returns blocks. Efficient, though the Args list is somewhat conventionally verbose rather than tightly compressed.

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?

Complete enough for a 7-parameter numerical solver with no output schema: inputs, precondition, and return contents are all covered. Missing only edge-case behavior for non-convergence or sign violations.

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 coverage is 0%, so the description must compensate and largely does: every one of the 7 parameters is explained, including the constraint b > a, the meaning of tol (residual/error), precision (rounding digits) and plot (adds a PNG). Only exact units/semantics of tol relative to the iteration stopping rule remain ambiguous.

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?

States a specific verb and resource ('Find a root of f(x) = 0 in [a, b]') plus the named algorithm (bisection), which immediately differentiates it from siblings like root_newton_raphson, root_punto_fijo and root_aitken.

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

Usage Guidelines4/5

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

Gives a clear precondition (f(a) and f(b) must have opposite signs, citing Bolzano) that effectively defines when the tool is applicable. It does not explicitly say when to prefer it over the other root-finding siblings, so it stops short of full alternative routing.

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