Skip to main content
Glama
IBM

Physics MCP Server

by IBM

calculate_jerk

Calculate jerk, the rate of change of acceleration, from time series acceleration data. Useful for assessing ride comfort and mechanical stress.

Instructions

Calculate jerk (rate of change of acceleration).

Jerk = da/dt is important for comfort in vehicles and mechanical design.

Args:
    times: Time values in seconds (or JSON string)
    accelerations: Acceleration vectors [[x,y,z], ...] in m/s² (or JSON string)

Returns:
    Dict containing:
        - jerks: Jerk vectors [[x,y,z], ...] in m/s³
        - average_jerk: Average jerk [x,y,z] in m/s³
        - max_jerk_magnitude: Maximum jerk magnitude in m/s³

Example:
    result = await calculate_jerk(
        times=[0, 1, 2, 3],
        accelerations=[[0,0,0], [2,0,0], [4,0,0], [6,0,0]]
    )
    # jerk_x ≈ 2 m/s³ (constant)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timesYes
accelerationsYes

Implementation Reference

  • MCP tool wrapper for calculate_jerk. Handles JSON string parsing, delegates to core function in kinematics.py. Decorated with @tool for MCP registration.
    @tool  # type: ignore[arg-type]
    async def calculate_jerk(
        times: Union[list[float], str],
        accelerations: Union[list[list[float]], str],
    ) -> dict:
        """Calculate jerk (rate of change of acceleration).
    
        Jerk = da/dt is important for comfort in vehicles and mechanical design.
    
        Args:
            times: Time values in seconds (or JSON string)
            accelerations: Acceleration vectors [[x,y,z], ...] in m/s² (or JSON string)
    
        Returns:
            Dict containing:
                - jerks: Jerk vectors [[x,y,z], ...] in m/s³
                - average_jerk: Average jerk [x,y,z] in m/s³
                - max_jerk_magnitude: Maximum jerk magnitude in m/s³
    
        Example:
            result = await calculate_jerk(
                times=[0, 1, 2, 3],
                accelerations=[[0,0,0], [2,0,0], [4,0,0], [6,0,0]]
            )
            # jerk_x ≈ 2 m/s³ (constant)
        """
        from ..kinematics import JerkCalculationRequest, calculate_jerk as calc_jerk
    
        # Parse inputs
        parsed_times = json.loads(times) if isinstance(times, str) else times
        parsed_accelerations = (
            json.loads(accelerations) if isinstance(accelerations, str) else accelerations
        )
    
        request = JerkCalculationRequest(
            times=parsed_times,
            accelerations=parsed_accelerations,
        )
        response = calc_jerk(request)
        return response.model_dump()
Behavior4/5

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

With no annotations, the description does well by explaining the calculation formula, input requirements (times in seconds, accelerations in m/s²), and the detailed return structure. However, it does not disclose potential error conditions or input validation.

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 a concise definition, parameter explanation, return format, and a clear code example. Every sentence adds value without redundancy.

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?

The description covers purpose, parameters, and returns in sufficient detail for a pure calculation tool. It lacks output schema but compensates by explicitly listing returned fields. Minor omission: no mention of error handling or input constraints.

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?

The schema only specifies type 'string' for both parameters, leaving 0% coverage. The description adds essential meaning: times are in seconds, accelerations are vector arrays in m/s², and both can be passed as JSON strings. This vastly compensates for the bare 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 'Calculate jerk (rate of change of acceleration)' with a specific verb and resource. It explains the physical importance and differentiates from sibling tools like calculate_angular_acceleration by focusing on linear jerk in 3D.

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?

The description provides context with an example but lacks explicit guidance on when to use this tool versus alternatives like calculate_acceleration_from_position. No exclusions or prerequisites are mentioned.

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