Skip to main content
Glama
eng-toolkit

eng-toolkit

by Lin830326

Optimize Fit

optimize_fit

Fits nonlinear models to data using bounded parameters, multistart optimization, and weighted least squares, then reports rank-checked covariance and t95 intervals.

Instructions

Fit nonlinear models with bounded LM, up to 12 parameters, 20000 rows and 64 starts. Each parameter is scaled by its initial value, so give initial values of the expected size. Reports rank-checked local covariance and t95 intervals. Grammar: numbers, names, + - * / ^ (**), parentheses, whitelisted math calls; no comparisons inside expressions. Variables are plain numbers in the units you choose; the tool does not track units inside expressions.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "optimize_fit"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataNoJSON column lists or rows, e.g. '{"x":[0,1,2],"y":[2,1,0.5]}'.
seedNoDeterministic random seed, e.g. 0; integer 0..4294967295, echoed in the result.
modelNoModel expression, e.g. 'a*exp(-b*x)'; parameters and independent names are allowed.
sigmaNoOptional JSON positive standard deviations, e.g. '[0.1,0.2,0.1]', one per row; blank means unit weights.
boundsNoParameter JSON bound pairs in initial order, e.g. '[[0,5],[0,2]]'; null means unbounded.
initialNoParameter initial records, e.g. 'a=2;b=0.5'; at most 12; a nonzero value also sets the parameter's scale.
data_fileNoOptional CSV path, e.g. 'observations.csv', with numeric named columns; use instead of data.
dependentNoDependent data column name, e.g. 'y'.y
toleranceNoDimensionless convergence tolerance, e.g. 1e-7; supported 1e-12..0.01.
multistartNoSeeded fit start count, e.g. 8; 1..64, best converged weighted least squares is retained.
time_limitNoWall-clock budget with time units, e.g. '10 s'; supported 0.001..60 s, shared by all solver stages.10 s
independentNoComma-separated independent column names, e.g. 'x' or 'x,z'.x
absolute_sigmaNoKnown-sigma covariance flag, e.g. true; false scales covariance by reduced chi-square.
max_iterationsNoLM iteration cap per start, e.g. 500; 1..2000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A3.6/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 does deliver real behavioral detail: parameter scaling by initial value, rank-checked covariance, t95 intervals, and a whitelisted expression grammar with no comparisons. What it omits is the failure profile — behavior on non-convergence, what a rank-deficient covariance means for the caller, and the shape of the returned object beyond the two named outputs.

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?

Four dense sentences, front-loaded with capability and limits before grammar rules and unit caveats. Nothing is padded, though the grammar sentence is compressed enough that an agent may need a second pass to parse the parenthesized operator list.

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 14-parameter numeric solver with no annotations and no output schema, the description covers the essentials: hard limits, scaling semantics, expression grammar, and a partial account of the return values (covariance and t95 intervals). The remaining gap is what happens on failure or poor conditioning, which matters for an optimizer whose default is a 10-second budget.

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 already 100%, so the baseline is 3, and the description exceeds it by explaining the semantics behind `initial` ('each parameter is scaled by its initial value, so give initial values of the expected size') and the grammar constraints governing `model`. That is meaning the schema does not convey and materially changes how the agent fills those fields.

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 opens with a specific verb and resource ('Fit nonlinear models with bounded LM') and immediately bounds scope with concrete limits (12 parameters, 20000 rows, 64 starts). It tells an agent exactly what class of problem this solves. It does not name or contrast any sibling such as optimize_minimize or metrology_fit_limits, so differentiation is left implicit.

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 rather than stated: the 12-parameter and 20000-row caps effectively signal when this tool is inappropriate, and 'give initial values of the expected size' is a practical instruction. However, there is no explicit when-to-use statement and no named alternative for smaller fits, linear problems, or root finding, which siblings appear to cover.

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

Deploy Server

Other Tools