Skip to main content
Glama
IBM

Physics MCP Server

by IBM

fit_trajectory

Fit polynomial to trajectory data for smoothing or deriving motion equations. Supports linear, quadratic, or cubic fits, returning coefficients and goodness-of-fit.

Instructions

Fit polynomial to trajectory data.

Useful for smoothing noisy data or finding trajectory equations.
Default fit_type="quadratic" fits parabolic trajectory (constant acceleration).

Args:
    times: Time values in seconds (or JSON string)
    positions: Position vectors [[x,y,z], ...] in meters (or JSON string)
    fit_type: Polynomial type - "linear", "quadratic", or "cubic" (default "quadratic")

Returns:
    Dict containing:
        - coefficients_x: Polynomial coefficients for x(t)
        - coefficients_y: Polynomial coefficients for y(t)
        - coefficients_z: Polynomial coefficients for z(t)
        - r_squared: R² goodness of fit (0-1)
        - predicted_positions: Fitted positions [[x,y,z], ...]

Example - Projectile motion:
    result = await fit_trajectory(
        times=[0, 1, 2, 3],
        positions=[[0,0,0], [10,15,0], [20,20,0], [30,15,0]],
        fit_type="quadratic"
    )
    # Fits x(t) = c0 + c1*t + c2*t²

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timesYes
positionsYes
fit_typeNoquadratic
Behavior3/5

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

No annotations provided, so description carries the burden. It describes outputs and example but does not disclose any side effects, destructive actions, or limitations. However, the tool appears to be a pure computation function, so the lack of behavioral warnings is acceptable.

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?

The description is well-structured with sections for description, args, returns, and example. Every sentence adds value, and it is appropriately sized without redundancy.

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

Completeness5/5

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

Given no annotations and no output schema, the description is complete: it explains what the tool does, all parameters, return values, and provides a concrete example. An AI agent has enough information to use it correctly.

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 has 0% description coverage (all string types), but the description explains each parameter: times in seconds, positions as vector arrays, fit_type with enumerated options. This adds significant meaning beyond the raw schema.

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 'Fit polynomial to trajectory data,' which is a specific verb+resource. It distinguishes from sibling tools like 'calculate_projectile_motion' by focusing on fitting curves to arbitrary trajectory data, not just projectile calculations.

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?

Mentions it's 'useful for smoothing noisy data or finding trajectory equations,' providing clear usage context. However, it does not explicitly state when not to use this tool or compare to alternative tools among siblings.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/IBM/chuk-mcp-physics'

If you have feedback or need assistance with the MCP directory API, please join our Discord server