Skip to main content
Glama
Lecoeurdelest

mujoco-mcp

mujoco_set_state

Idempotent

Set specific physics quantities (qpos, qvel, ctrl, time) in a MuJoCo session, then update derived values so body poses and sensors match. Use it to define initial conditions or restore states for visual replay.

Instructions

Overwrite parts of a session's state (qpos, qvel, ctrl, time), then recompute derived quantities.

Only provided fields change. Runs mj_forward so sensors/body poses reflect the new state
without advancing time. Returns the resulting state JSON. Useful for setting initial
conditions or visual replay. Use snapshots, not rounded state views, for exact continuation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ctrlNoActuator controls: full vector in actuator order, or {actuator_name: value} for a subset. Persists on the session until changed.
qposNoFull generalized positions, length nq; free-joint quaternions must be unit norm
qvelNoFull generalized velocities, length nv
timeNoOverride simulation clock (seconds)
precisionNoDecimal places for returned floats
session_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations, the description discloses critical mechanics: only provided fields change, mj_forward runs so derived quantities update, time does not advance, and the resulting state JSON is returned. The idempotentHint and non-destructive annotations are consistent with the description, and the partial-update detail is valuable.

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 front-loaded with the core action and then adds compact, high-value behavioral and usage notes. Every sentence earns its place; there is no repeated schema content or filler.

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 an output schema present, the return shape is already covered. The description supplies the remaining context an agent needs: how the state overwrite behaves, how derived quantities are recomputed, why time is unaffected, and when to prefer snapshots instead.

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?

Schema coverage is high at 83% and the parameter descriptions are already detailed. The description adds the crucial partial-update semantic ('Only provided fields change') and hints at precision behavior with 'rounded state views.' It doesn't elaborate on session_id, but that parameter is self-evident.

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 states a specific verb and resource: 'Overwrite parts of a session's state' with qpos, qvel, ctrl, and time listed. It also differentiates from the snapshot-restore sibling by noting that snapshots, not rounded state views, should be used for exact continuation.

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 explicitly says this is 'useful for setting initial conditions or visual replay' and gives a clear when-not instruction: 'Use snapshots, not rounded state views, for exact continuation.' This routes the agent away from an inappropriate use case and toward the sibling restore_snapshot behavior.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.