Skip to main content
Glama

Measure a scene's frame times

godot_perf

Runs a Godot scene headless and reports frame-time percentiles, physics step cost, and slow-frame causes against a budget, comparing each run to its prior baseline.

Instructions

Run a scene in Godot 4.7 headless and measure it the way a player feels it: frame-time p50, p95, p99 and max against a budget (default 16.6 ms), the physics step apart from the rest of the frame, the slowest frames with what changed on them (nodes made or freed in one frame, a heavy physics step, script work), node and orphan counts, and the change since the last run of the same scene (kept in .godot/godotwright/perf/). Headless measures the CPU side (scripts, physics, scene work), not the GPU. input plays a timeline as godot_play does, to measure while something happens. An error result when p95 is over budget or more than 10% worse than last time. Lessons that fit the numbers are named. Measure before and after every performance change.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "godot_perf"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoproject folder, or a file or folder inside it (relative to the server's folder; default: the current project)
inputNoinput while measuring: "10 hold right 300"
sceneNothe res:// scene to measure (default: the main scene)
framesNoframes to measure (default 600)
warmupNoframes to run first without measuring (default 60)
baselineNocompare with and save the last run of this scene (default true)
budget_msNoframe budget in ms (default 16.6)
timeout_secondsNotimeout of the run (default 300)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.0
    • changedInput schema / properties / path / description
      Previous value: -"The project folder, or any file or folder inside it (Godotwright walks up to project.godot). Relative paths start at the server's folder. Default: the current project."New value: +"project folder, or a file or folder inside it (relative to the server's folder; default: the current project)"
  2. Addedv0.2.2

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing persistent state (baseline kept in .godot/godotwright/perf/), the failure contract ('An error result when p95 is over budget or more than 10% worse than last time'), and the headless/CPU-only measurement limit. The only gap is that it doesn't mention run duration expectations beyond the default timeout, which the schema already constrains.

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?

Front-loaded with the core action and measurement outputs, then constraints; every clause carries information (percentiles, physics split, persistence path, GPU exclusion, error rule). It is a dense single block, however, and would scan faster as short separated statements.

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?

There is no output schema, and the description compensates fully by enumerating what the result contains (percentiles, slowest frames with attributed causes, node/orphan counts, delta vs. last run, named lessons that fit). For an 8-parameter tool with meaningful side effects, nothing an agent needs to call it correctly is missing.

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 100%, so baseline is 3, but the description adds real meaning: what `input` does and that it mirrors godot_play, that `budget_ms` is the threshold that triggers an error result, and that `baseline` both compares and saves. These are behavioral semantics the schema text alone does not convey.

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?

States a specific verb and resource: run a scene headless in Godot 4.7 and measure frame times, naming the exact statistics (p50/p95/p99/max), the physics split, slowest frames, node/orphan counts, and baseline delta. This clearly separates it from sibling godot_play (which plays input without measuring) and from static tools like godot_review.

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?

Gives explicit when-to-use guidance ('Measure before and after every performance change') and a scope exclusion ('Headless measures the CPU side ... not the GPU'). It also explains the relationship to a sibling: `input` plays a timeline as godot_play does, so the agent knows when to reach for each.

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