Skip to main content
Glama
mathmethods-mcp

mathmethods-mcp

root_newton_raphson

Find a root of f(x)=0 using Newton-Raphson with numeric derivative, returning the root, convergence status, iteration table, and optional plot.

Instructions

Find a root of f(x) = 0 with the Newton-Raphson method (numeric derivative).

Args: func_str: Math expression in x. x0: Initial guess. tol: Convergence tolerance. max_iter: Maximum iterations. precision: Rounding digits. plot: When True, also return a PNG plot of f(x) and the root.

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

Input Schema

NameRequiredDescriptionDefault
x0Yes
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

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It usefully discloses the return shape (root, iteration table, convergence flag) and the plot side effect, which is real behavioral value, but it omits failure/divergence behavior, side effects of precision, and what happens on non-convergence.

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?

Well-structured with a front-loaded purpose sentence followed by Args and Returns sections. It is slightly redundant with the schema's parameter names, but that redundancy is defensible given 0% schema coverage.

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, the Returns section fills the gap by describing the dict contents and the plot=True variant. Combined with per-parameter documentation, an agent has enough to invoke it correctly, though convergence-failure semantics remain unstated.

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 documents all six parameters in an Args block. func_str ('Math expression in x') and precision ('Rounding digits') add genuine meaning beyond the bare names, though tol and max_iter are near-restatements.

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+resource ('Find a root of f(x) = 0') and names the exact algorithm ('Newton-Raphson method') plus an implementation detail (numeric derivative), which distinguishes it from siblings like root_bisection and root_punto_fijo. It does not explicitly contrast with those siblings, keeping it at 4.

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 implied by the named method rather than stated: nothing tells the agent when Newton-Raphson is preferable to bisection or fixed-point, nor does it warn about cases where the numeric derivative is zero or the initial guess diverges. The tool's applicability is inferable but not explicit.

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