Skip to main content
Glama
IBM

Physics MCP Server

by IBM

fit_trajectory

Fit polynomial equations to trajectory data for smoothing noisy measurements or deriving motion equations, supporting linear, quadratic, or cubic fits to model constant acceleration or other motion patterns.

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
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it performs polynomial fitting, explains the default fit type and its physical interpretation, and details the return structure including coefficients and goodness of fit. However, it lacks information on error handling, performance characteristics, or limitations.

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 and appropriately sized. It starts with a clear purpose statement, followed by usage context, parameter details, return values, and a practical example. Every sentence adds value without redundancy, and information is front-loaded for quick understanding.

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?

Given the tool's complexity (polynomial fitting with 3 parameters) and lack of annotations and output schema, the description does an excellent job covering purpose, usage, parameters, and returns. However, it could improve by addressing potential issues like input validation, error cases, or performance notes, which would make it fully complete for this context.

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

Parameters5/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 fully compensate. It provides detailed semantics for all three parameters: times (time values in seconds), positions (position vectors in meters), and fit_type (polynomial type with options and default). It also clarifies data formats (e.g., JSON string alternatives) and includes an example showing usage.

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: 'Fit polynomial to trajectory data.' It specifies the action (fit polynomial) and resource (trajectory data), distinguishing it from sibling tools like calculate_projectile_motion or record_trajectory, which perform different operations on trajectory data.

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 provides clear context for when to use the tool: 'Useful for smoothing noisy data or finding trajectory equations.' It mentions the default behavior ('Default fit_type="quadratic" fits parabolic trajectory') but does not explicitly state when not to use it or name specific alternatives 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