Skip to main content
Glama
IBM

Physics MCP Server

by IBM

record_trajectory_with_events

Track object motion in physics simulations and automatically identify bounce events and collisions during trajectory recording.

Instructions

Record trajectory and automatically detect collision and bounce events.

This is an enhanced version of record_trajectory that analyzes the motion
and detects important events like bounces and collisions. Perfect for
answering questions like "how many times did the ball bounce?"

Args:
    sim_id: Simulation ID
    body_id: Body to track
    steps: Number of simulation steps to record
    dt: Optional custom timestep (overrides simulation default)
    detect_bounces: Whether to detect bounce events (default True)
    bounce_height_threshold: Maximum height to consider as "on ground" in meters (default 0.01)

Returns:
    TrajectoryWithEventsResponse containing:
        - frames: Trajectory frames (positions, velocities)
        - bounces: Detected bounce events with energy loss
        - contact_events: Contact/collision events (future)

Tips for LLMs:
    - Use this instead of record_trajectory when you need event detection
    - Bounces are detected from velocity reversals near the ground
    - Each bounce includes: time, position, speeds before/after, energy loss
    - Use `trajectory.bounces` to count or analyze bounces
    - Adjust bounce_height_threshold for different ground shapes

Example:
    # Record ball bouncing and count bounces
    traj = await record_trajectory_with_events(
        sim_id=sim_id,
        body_id="ball",
        steps=600,
        detect_bounces=True,
        bounce_height_threshold=0.01  # 1cm threshold
    )
    print(f"Detected {len(traj.bounces)} bounces")
    for bounce in traj.bounces:
        print(f"Bounce #{bounce.bounce_number} at t={bounce.time:.2f}s")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sim_idYes
body_idYes
stepsYes
dtNo
detect_bouncesNo
bounce_height_thresholdNo
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 what the tool does (records trajectory, detects events), explains how bounces are detected ('from velocity reversals near the ground'), and details the return structure (frames, bounces, contact_events). It also mentions event details like energy loss and provides practical tips for usage. However, it doesn't cover potential side effects, error conditions, or performance characteristics.

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: purpose statement, parameter explanations, return values, LLM tips, and an example. While comprehensive, some sections (like the detailed example) are lengthy but justified by the tool's complexity. Every sentence adds value, though it could be slightly more condensed in the tips section.

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 (6 parameters, no annotations, no output schema), the description does an excellent job of explaining what the tool does, how to use it, parameter meanings, and return structure. It provides practical examples and usage tips. The main gap is the lack of explicit output schema documentation, though the return description partially compensates. For a mutation/analysis tool with rich functionality, this is nearly complete.

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?

With 0% schema description coverage, the description must compensate for all 6 parameters. It provides clear explanations for each parameter: sim_id, body_id, steps, dt, detect_bounces, and bounce_height_threshold. The descriptions include default values, purposes, and practical context (e.g., 'Maximum height to consider as "on ground" in meters'). The only minor gap is that 'dt' could be more explicitly tied to simulation behavior.

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: 'Record trajectory and automatically detect collision and bounce events.' It specifies the verb ('record'), resource ('trajectory'), and enhancement ('detect events'), and explicitly distinguishes it from its sibling 'record_trajectory' by calling it an 'enhanced version' with event detection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidelines: 'Use this instead of record_trajectory when you need event detection' and gives a concrete example ('Perfect for answering questions like "how many times did the ball bounce?"'). It clearly defines when to use this tool versus its sibling alternative.

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