Skip to main content
Glama
IBM

Physics MCP Server

by IBM

record_trajectory_with_events

Records trajectory and automatically detects bounce events with energy loss. Use to count bounces and analyze collisions.

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?

Despite no annotations, the description explains bounce detection via velocity reversals near ground, the role of bounce_height_threshold, and the returned fields (bounces with time/position/speeds/energy loss). It does not cover potential side effects or performance considerations, but adequately discloses key behavioral traits.

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?

Well-structured with clear sections: short intro, formatted Args/Returns, actionable Tips, and a concise Example. Every sentence adds value; no fluff. Length is appropriate for the tool's complexity.

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?

Covers purpose, parameters, return structure (frames, bounces, contact_events), and typical use case with an example. However, it lacks details on the output fields beyond bounces, and does not mention how contact_events will be structured or if any side effects occur on the simulation. Still, it is largely complete for a simulation tool with no output schema.

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?

Input schema provides only types and defaults (0% description coverage). The description fully compensates with detailed Args documentation explaining each parameter's purpose, default behavior, and practical usage (e.g., dt override, bounce_height_threshold meaning). The example shows concrete parameter values.

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?

Clearly states the tool records trajectory and detects collision/bounce events, enhancing the sibling record_trajectory. The description explicitly differentiates by labeling it an 'enhanced version' and listing detected event types.

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?

Provides explicit guidance: 'Use this instead of record_trajectory when you need event detection.' The Tips section further advises on when to adjust parameters like bounce_height_threshold, and includes an example that demonstrates typical usage for bounce counting.

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