Skip to main content
Glama

rl_record_rollout

Render an RL episode, return a contact sheet of frames, and save a GIF on the runtime for visual rollout inspection.

Instructions

Render an episode and return a contact sheet of frames (and save a gif on the runtime).

rollout_code runs on the runtime and MUST leave a variable frames — a list of HxWx3 uint8 arrays (e.g. from env.render() with render_mode='rgb_array'). A rollout.gif is written to the run dir; download it with download_file.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "run_name": "<run_name>",
      "rollout_code": "<rollout_code>"
    },
    "name": "rl_record_rollout"
  }
}

Input Schema

NameRequiredDescriptionDefault
run_nameYes
max_framesNo
rollout_codeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that arbitrary user code executes on the runtime, that the code MUST define a `frames` variable with a specific HxWx3 uint8 contract, and that a `rollout.gif` artifact is written to the run dir. It leaves out failure behavior when `frames` is missing or malformed, and how max_frames interacts with truncation.

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?

Purpose and the gif side effect are front-loaded in the first sentence, followed by the code contract. Every sentence carries information; only the parenthetical nested inside the opening sentence is slightly clunky.

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?

With no output schema, the description correctly describes both the returned contact sheet and the on-disk artifact, plus the route to fetch it. The main remaining gap is the meaning of `run_name` and `max_frames`, which leaves the call signature partly unspecified for a three-parameter tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does so fully for `rollout_code` by specifying the required `frames` variable, its type, and a concrete example. However, `run_name` and `max_frames` get no explanation at all, so roughly a third of the parameters' meaning is still undocumented.

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 opens with a concrete verb and resource ('Render an episode and return a contact sheet of frames') and immediately names the side effect ('save a gif on the runtime'). It also points at the sibling needed to retrieve that artifact ('download it with download_file'), so an agent can distinguish this from rl_reward_curve or rl_seed_sweep without opening a schema.

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

Usage Guidelines3/5

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

Usage is only implied: the agent can infer this is the tool for visualizing a policy episode and that download_file is the follow-up for the gif. There is no explicit statement of when to prefer this over the other rl_* inspection tools, no prerequisites, and no exclusions.

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