Skip to main content
Glama

Theme Manage

theme_manage

Create and edit Godot Theme resources programmatically: set colors, constants, fonts, icons, and styleboxes, then apply themes to Control nodes for cascading styling.

Instructions

Theme authoring (Godot's stylesheet-like resource for Controls). Cascades down a Control subtree when assigned via theme_apply.

Stylebox numeric fields (border widths, corner radii, margins, shadow) must be finite numbers and stylebox flags (anti_aliasing, draw_center) must be real booleans; a non-numeric or non-finite value is refused with a structured error before anything is applied, so a refused call leaves the theme and undo history untouched.

Slot changes are persisted immediately: if the theme file cannot be written the call fails with an error, the previous slot is restored, and no undo entry is committed.

Ops (pass via op="..." plus a params dict): • create(path, overwrite=False) Create a new empty Theme .tres at a res:// path. • set_color(theme_path, class_name, name, value) Set a color slot. value: "#rrggbb"/"#rrggbbaa", named, or {"r","g","b","a"}. • set_constant(theme_path, class_name, name, value) Set an integer constant (separation, margin, padding). • set_font_size(theme_path, class_name, name, value) Set a font_size slot in pixels. • set_stylebox_flat(theme_path, class_name, name, bg_color?, border_color?, border?, corners?, margins?, shadow?, anti_aliasing?) Compose a StyleBoxFlat (panels, button states, line edits). border/corners/margins/shadow each accept "all" + per-side keys. • set_stylebox_texture(theme_path, class_name, name, texture_path, region?, margins?, axis_stretch_horizontal?, axis_stretch_vertical?, modulate_color?, draw_center?) Compose a 9-slice StyleBoxTexture from an imported image — pixel-art buttons and artwork-backed panels. region is {position, size} or [x,y,w,h]; margins are {all|left|top|right|bottom}; axis stretch modes are "stretch" | "tile" | "tile_fit". • set_font(theme_path, class_name, name, font_path) Assign a Font resource (FontFile .ttf/.otf, FontVariation) to a font slot. Loads the imported resource from res://. • set_icon(theme_path, class_name, name, texture_path) Assign a Texture2D to an icon slot (checkbox marks, dropdown arrows). • stylebox_override(path, slot, patch) Per-node stylebox override: duplicate the stylebox the Control resolves for slot, apply a StyleBoxFlat patch (same keys as set_stylebox_flat; unknown top-level keys are refused), and attach it via add_theme_stylebox_override. The action lands in the scene's undo history, so the editor's scene undo restores the previous override or removes it. The zero-border angular-frame / flash-the-bar-bg pattern without mutating the theme. • apply(node_path, theme_path="") Assign the theme to a Control (cascades to descendants). Empty theme_path clears.

All ops accept session_id on the wrapper to target a specific editor.

Canonical call shape: {"op": "<verb>", "params": {...}}. Flat op parameters are accepted as a compatibility alias when the client transmits them; op and session_id remain top-level.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opYes
paramsNo
session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.2.1
    • changedInput schema / properties / op / enum
      Previous value: -[
      -  "apply",
      -  "create",
      -  "set_color",
      -  "set_constant",
      -  "set_font_size",
      -  "set_stylebox_flat"
      -]New value: +[
      +  "apply",
      +  "create",
      +  "set_color",
      +  "set_constant",
      +  "set_font",
      +  "set_font_size",
      +  "set_icon",
      +  "set_stylebox_flat",
      +  "set_stylebox_texture",
      +  "stylebox_override"
      +]
  2. Addedv3.1.4
  3. Removedv3.0.7
  4. First observedv2.9.1

TDQS

A4.8/5.0
Behavior5/5

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

With zero annotations, the description carries the full behavioral burden and succeeds: it discloses validation semantics ('a non-numeric or non-finite value is refused with a structured error before anything is applied'), atomicity ('refused call leaves the theme and undo history untouched'), persistence semantics ('Slot changes are persisted immediately... the previous slot is restored, and no undo entry is committed'), and per-op undo behavior (stylebox_override 'lands in the scene's undo history'). This goes well beyond anything the schema could express.

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 long, but the length is proportionate to the 10 sub-operations it must document. It is front-loaded with purpose and cascade behavior, organizes ops as a bulleted list with nested parameter notes, and closes with the canonical call shape. No filler sentences; every sentence earns its place.

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 high complexity (10 ops, polymorphic params, persistence and undo guarantees) and the absence of annotations, the description leaves nothing essential to inference: params, value formats, validation/rollback behavior, and the call envelope are all specified. An output schema exists to cover return values, so the description's silence on success-return shape is acceptable.

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% — the schema only declares op/params/session_id with a permissive params object and op enum. The description fully compensates by documenting every op's parameters in detail: color value formats ('#rrggbb'/'#rrggbbaa', named, or {r,g,b,a}), region formats ('{position, size} or [x,y,w,h]'), axis-stretch enums ('stretch' | 'tile' | 'tile_fit'), and per-side key conventions ('all' + per-side keys). An agent can construct a correct params dict from the description alone.

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?

Opens with a specific scope — 'Theme authoring (Godot's stylesheet-like resource for Controls)' — and immediately adds a distinguishing behavior ('Cascades down a Control subtree when assigned via theme_apply'). The verb+resource pairing is specific enough to stand apart from siblings like material_manage, resource_manage, ui_manage, and material-related tools, so an agent can tell what domain this tool owns.

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

Usage Guidelines4/5

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

The opening sentence establishes clear context for when to use the tool: authoring Godot Control themes, which implicitly distinguishes it from general-purpose resource_manage, ui_manage, and material_manage. Internal op routing is strong (e.g., stylebox_override is contrasted with set_stylebox_flat as a pattern used 'without mutating the theme'). It stops short of explicitly naming sibling tools with when-not-to-use conditions, so cross-tool exclusion guidance is left to inference.

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