Skip to main content
Glama

css_apply

Apply CSS to live panels as inline styles. Replaces earlier CSS with the same sheet name.

Instructions

Apply CSS to live panels as inline styles. Replaces earlier CSS with the same sheet name.

persist=True re-applies about once a second so panels the game recreates stay styled. Supports type, #id, .class, descendant and '>' selectors; pseudo-classes and at-rules are skipped (use xml_load's css for those on new panels, or compile_source for permanent game-wide styles).

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": {
      "css": "<css>"
    },
    "name": "css_apply"
  }
}

Input Schema

NameRequiredDescriptionDefault
uiNoauto
cssYes
sheetNodefault
persistNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the disclosure burden and does well: it states that CSS with the same sheet name is replaced, that persist re-applies roughly once per second to survive panel recreation, and which selector forms are skipped. It stops short of covering error behavior or whether the game must be running.

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-loads the core action and replacement rule, then layers persist behavior and selector limitations. Dense but every sentence carries information; the parenthetical sibling routing is slightly compressed but not wasteful.

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?

An output schema exists, so return values needn't be described, and the main behavioral pitfalls (replacement, re-application, unsupported selectors) are covered. The only real gap is the unexplained ui parameter for a tool with four inputs.

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 0%, so the description must compensate; it explains the sheet parameter via the same-name replacement rule and the persist parameter in detail. The css parameter is implicitly clear from context, but the ui parameter (default 'auto') is never mentioned, leaving one of four parameters unexplained.

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 concrete verb+resource (apply CSS to live panels), specifies the mechanism (inline styles), and differentiates itself from siblings by pointing to xml_load and compile_source for the cases it doesn't handle.

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?

Explicitly routes the agent: use xml_load's css for pseudo-classes/at-rules on new panels, compile_source for permanent game-wide styles, and this tool for live inline styling. It also explains what persist=True buys you, so the when-to-use decision is fully supported.

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