Skip to main content
Glama

stage_bake_simulation

Converts physics simulation data into keyframe animations for export to React Three Fiber or Remotion, enabling physics-driven video rendering.

Instructions

Bake physics simulation to keyframe animations.

Converts physics simulation data into keyframes that can be
exported to R3F/Remotion for video rendering.

Args:
    scene_id: Scene identifier
    simulation_id: Physics simulation ID from chuk-mcp-physics
    fps: Frames per second for sampling (default 60)
    duration: Duration in seconds to bake (if None, bakes entire simulation)
    physics_server_url: Optional Rapier HTTP server URL
        If None, defaults to public Rapier service (https://rapier.chukai.io)
        Can be overridden with RAPIER_SERVICE_URL environment variable

Returns:
    BakeSimulationResponse with frame count and baked object list

Tips for LLMs:
    - Run physics simulation first (chuk-mcp-physics step_simulation or record_trajectory)
    - Bind objects to physics bodies (stage_bind_physics)
    - Bake simulation to convert physics → animation keyframes
    - Then export scene to R3F/Remotion with animation data

Example:
    # After running simulation and binding objects
    result = await stage_bake_simulation(
        scene_id=scene_id,
        simulation_id=sim.sim_id,
        fps=60,
        duration=10.0
    )
    print(f"Baked {result.total_frames} frames for {len(result.baked_objects)} objects")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_idYes
simulation_idYes
fpsNo
durationNo
physics_server_urlNo
Behavior4/5

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

No annotations provided, so the description carries the full burden. It explains the conversion process, default service URL, and optional duration. However, it does not mention side effects like whether the original simulation data is retained or destroyed.

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 (description, Args, Returns, Tips, Example). While slightly verbose, it front-loads the main purpose and uses efficient bullet points.

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?

With no annotations and no output schema, the description includes return type description and a concrete example. It also provides the full workflow context via tips, making it complete for agent usage.

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 coverage is 0%, but the description fully explains all parameters in the 'Args' section, including defaults, optionality, and environment variable override for physics_server_url. This adds significant meaning beyond the raw 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 it converts physics simulation data into keyframes for animation, specifically mentioning integration with R3F/Remotion. It distinguishes from sibling tools like stage_bind_physics and stage_export_scene by outlining the workflow.

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 'Tips for LLMs' section provides explicit steps: run physics simulation first, bind objects, then bake, then export. This gives clear when-to-use guidance and distinguishes it from other tools.

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/chrishayuk/chuk-mcp-stage'

If you have feedback or need assistance with the MCP directory API, please join our Discord server