Skip to main content
Glama
IBM

Physics MCP Server

by IBM

record_trajectory

Track a body's motion over time to generate animation data for physics simulations, recording position, orientation, and velocity at specified intervals.

Instructions

Record the trajectory of a specific body over time.

Steps the simulation and records position/orientation/velocity at each
timestep for one body. Perfect for generating animation data for R3F.

Args:
    sim_id: Simulation ID
    body_id: ID of the body to track
    steps: Number of timesteps to record
    dt: Optional timestep override. If None, uses config default.

Returns:
    TrajectoryResponse containing:
        - body_id: Tracked body identifier
        - frames: List of trajectory frames with time, position, orientation, velocity
        - total_time: Total simulated time in seconds
        - num_frames: Number of frames recorded

Tips for LLMs:
    - Each frame has: time, position [x,y,z], orientation [x,y,z,w], velocity [x,y,z]
    - Frames are evenly spaced in time (every dt seconds)
    - Output is R3F-compatible: use position/orientation directly in Three.js
    - For 60 FPS video: record at dt=1/60 ≈ 0.0167
    - Typical recording: 100-1000 frames (1.6-16 seconds at 60 FPS)

Example:
    # Record 5 seconds of a falling ball
    traj = await record_trajectory(
        sim_id=sim_id,
        body_id="ball",
        steps=300  # 300 × 0.016 ≈ 5 seconds
    )
    # Use traj.frames in React Three Fiber for animation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sim_idYes
body_idYes
stepsYes
dtNo
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing behavioral traits: it describes the recording process ('steps the simulation'), output format (R3F-compatible frames), timing behavior ('frames are evenly spaced in time'), and practical considerations like FPS recommendations. It doesn't mention error conditions or performance limits, keeping it from a perfect score.

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, args, returns, tips, example) and front-loaded key information. While slightly lengthy due to the detailed tips and example, every sentence adds value, such as the R3F compatibility notes and FPS calculations, making it efficient for its complexity.

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 the tool's complexity (4 parameters, simulation recording) and lack of annotations/output schema, the description is remarkably complete. It covers purpose, parameters, return structure, usage tips, and includes a practical example, providing all necessary context for an AI agent to understand and invoke the tool correctly.

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?

Despite 0% schema description coverage, the description comprehensively explains all 4 parameters in the 'Args' section, adding meaning beyond the basic schema types. It clarifies 'dt' as an optional timestep override with default behavior, and 'steps' as number of timesteps to record, providing practical context missing from the 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 the tool's purpose with specific verbs ('record', 'steps') and resources ('trajectory of a specific body over time'), distinguishing it from siblings like 'record_trajectory_with_events' by focusing on continuous recording without events. It explicitly mentions generating animation data for R3F, which adds context beyond basic functionality.

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 guidance on when to use this tool, including tips for LLMs on scenarios like 60 FPS video recording and typical frame ranges. It distinguishes from alternatives by noting it's 'perfect for generating animation data for R3F', though it doesn't explicitly contrast with 'record_trajectory_with_events' beyond the name difference.

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