Skip to main content
Glama

Try a CSS fix on the live page before editing files

visual_apply

Applies CSS hypotheses to elements in a throwaway page and re-measures at the original viewports to confirm a finding is fixed and check for collateral issues, without writing to disk.

Instructions

Takes a hypothesis as CSS declarations, applies them to the element(s) in a throwaway page, and re-measures at the same viewports and condition where the finding was observed. Reports whether the target observation disappeared AND whether new observations appeared elsewhere (collateral). It also captures the computed value before and after each declaration: an inline style can lose to an !important rule, and a patch that applies but changes nothing would otherwise look like a fix. Nothing is written to disk — this validates the hypothesis, then you edit the real 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": {
      "patches": "<patches>"
    },
    "name": "visual_apply"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoVerification mode. Default fast (1 pass).
patchesYesThe hypothesis. Applied as inline styles, so it beats ordinary author rules.
sessionIdNoSession from visual_audit/crawl. Defaults to the most recent.
findingIdsNoFindings you are trying to fix. Their viewports and condition are reused. Omit to keep the whole session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.3

TDQS

A4.4/5.0
Behavior5/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 it well: no disk side effects, verification at the original viewport and condition, explicit collateral-observation reporting, and before/after computed values. It even flags a subtle failure mode (an inline style losing to an !important rule, or a patch that applies but changes nothing) that would otherwise be mistaken for a fix.

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?

Four sentences, each earning its place: purpose first, then verification semantics, then the computed-value caveat, then the no-disk-write boundary. Nothing is repeated from the schema or title, and the most important constraint is front-loaded.

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?

No output schema exists, yet the description explains what the result reports (target observation gone, collateral observations, computed before/after), which is exactly what an agent needs to interpret the response. Combined with the no-write guarantee, the definition is complete for a 4-parameter validation tool.

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 description coverage is 100%, so the baseline is 3, and the description adds real meaning on top: patches are applied as inline styles, and it explains why computed values are captured (inline styles can lose to !important). It says less about mode (fast vs deep) and sessionId defaulting, which remain schema-only.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

A specific verb and resource: it applies CSS declarations to elements in a throwaway page and re-measures at the observed viewports. It also implicitly separates itself from real file editing ('then you edit the real file'), but it never names a distinguishing sibling such as visual_recheck or visual_compare, so the boundary against those is left to inference.

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 context is clear: use it to validate a CSS hypothesis before touching real files, and it reuses selectors and viewports from findings. The exclusion ('nothing is written to disk') is stated, but there is no explicit comparison to the other visual_* tools an agent might reach for instead.

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