Skip to main content
Glama

curve_fit

Fit a mathematical model to data using scipy.optimize.curve_fit with a sympy-parsed expression. Use for regression and parameter estimation.

Instructions

Fit y = model(x) to data with scipy.optimize.curve_fit using a sympy-parsed expression.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
p0No
modelYes
xdataYes
ydataYes
param_namesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.8/5.0
Behavior2/5

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

With no annotations and no output schema, the description carries the full behavioral burden and mostly does not meet it. It does not say what is returned (fitted parameters, covariance, residuals), what happens on non-convergence, what default p0 is used, or which scipy method is selected — all things an agent needs before calling a numerical optimizer.

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?

A single well-formed sentence with the core action front-loaded and no filler. Nothing in it is redundant or padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter numerical tool with zero schema documentation, no annotations, and no output schema, the description is far too thin. It omits return values, convergence/error behavior, the meaning of the string-accepting data parameters, and the default initial-guess behavior, leaving the agent under-informed for a nontrivial call.

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

Parameters2/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 only clarifies 'model' as a sympy-parsed expression. Nothing explains p0 (initial guess), param_names, or why xdata/ydata accept strings in addition to numeric arrays — the string variant is completely opaque.

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?

Names a specific operation (least-squares curve fitting) plus the exact engines involved (scipy.optimize.curve_fit with a sympy-parsed model expression), which is more specific than a generic 'fit' verb. It does not, however, distinguish itself from nearby siblings such as linear_regression, nonlinear_mixed_lm, global_optimize, or optimize_minimize, so an agent must infer the boundary.

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 statement of when to choose this over linear_regression, global_optimize, interpolate_1d, or optimize_minimize, nor any prerequisite or constraint. The only implicit signal is that the model is a sympy expression, which hints at nonlinear parametric fitting but is not framed as guidance.

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