Skip to main content
Glama
Axiomatic-AI

axiomatic-mcp

Official
by Axiomatic-AI

AxModelFitterLegacy_calculate_r_squared

Calculate R-squared from mean squared error and original data to evaluate how well your model explains observed variance. Use this metric to determine if your optimization produced a good fit.

Instructions

LEGACY TOOL (AxModelFitterLegacy, formerly AxModelFitter): existing workflows built on this toolset should continue to use it — it is the unchanged continuation of the original AxModelFitter tools. For NEW workflows, prefer the new AxModelFitter server's generate_code/execute_code tools (console script axiomatic-modelfitter). This legacy toolset will be removed in the next major release.

Calculate R-squared to measure how well your model fits the data.

SIMPLE USAGE:
- mse: The MSE value from your optimization result
- data_file: Path to your original data file
- output_data: Which columns contain your measured values

WHAT R² MEANS:
- R² = 1.0: Perfect fit (model explains 100% of variance)
- R² = 0.8: Good fit (model explains 80% of variance)
- R² = 0.0: Poor fit (model no better than just using the mean)
- R² < 0.0: Very poor fit (model worse than just using the mean)

WORKS WITH:
- Single output: output_data = {"columns": ["voltage"], "name": "v", "unit": "volt"}
- Multiple outputs: output_data = {"columns": ["x", "y"], "name": "position", "unit": "meter"}

Use this to quickly assess if your optimization produced a good fit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mseYesMean squared error from the optimization
data_fileYesPath to data file (CSV, Excel, JSON, Parquet). All data must be provided via file.
file_formatNoFile format: 'csv', 'excel', 'json', 'parquet' (auto-detect if None)
output_dataYesOutput column mapping: {'columns': ['y'], 'name': 'y', 'unit': 'volt'} or {'columns': ['y1', 'y2'], 'name': 'y', 'unit': 'volt'}

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.20

TDQS

A4.1/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 describes a calculation operation but does not explicitly state whether it is read-only or if it modifies any files or state. Given that it's a calculation from inputs (mse, data_file, output_data), it's implied to be non-destructive, but the description doesn't disclose any side effects, error conditions, or permissions. The R² interpretation and examples add contextual value but not explicit behavioral guarantees.

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?

The description is well-structured with clear sections (legacy warning, simple usage, R² meaning, works with examples). It is somewhat lengthy but each section serves a purpose: the legacy warning is critical for tool selection, the R² interpretation helps the agent assess results, and the examples clarify parameter structure. Information is front-loaded with the legacy note, which is the most important context. It could be tightened, but it's not verbose.

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 simple calculation tool, the description covers the key aspects: what it does, how to use it (parameter guidance), what the result means (R² interpretation), and when to use it (legacy workflows). It lacks an explicit statement of the return value (e.g., 'returns the R² value as a float'), but that is strongly implied. Since there is no output schema, the description could have been more explicit about the output format, but overall it is quite complete for a calculation tool.

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 100%, so the baseline is 3. The description adds value beyond the schema by providing concrete examples for output_data (single and multiple outputs) and explaining the meaning of each parameter in the 'SIMPLE USAGE' section. It also clarifies that all data must be provided via file, which reinforces the data_file description. This goes beyond the schema's basic descriptions.

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?

The description clearly states the tool's purpose: 'Calculate R-squared to measure how well your model fits the data.' It names the exact metric and explains its interpretation. It also distinguishes itself from the new AxModelFitter tools by labeling itself as the legacy continuation, which differentiates it from siblings like AxModelFitter_generate_code.

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?

The description explicitly says existing workflows should continue using this tool, while new workflows should prefer the new AxModelFitter server's generate_code/execute_code tools. It also says 'Use this to quickly assess if your optimization produced a good fit,' giving a clear use case. However, it does not mention alternatives within the legacy toolset, such as calculate_information_criteria, which could be a better choice for model comparison.

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