Skip to main content
Glama

capture_component

Read-only

Serialize any page component into a portable rebuild pack with structure, computed-style tokens, animations, typography usage, and color palette summaries.

Instructions

Serialize a page component (structure, computed-style tokens, animations) into a portable pack for rebuild tooling. Adds typography usage summaries (families/sizes/weights/line-heights/letter-spacings, top 12 each + sampled node count) and paletteSummary (colour counts from node styles + pack colors, transparent/rgba(0,0,0,0)/none filtered, top 24). compact=true returns a token-diet summary and omits both. Runs on any URL — does not fetch awwwards.com.

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": {
      "url": "<url>"
    },
    "name": "capture_component"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesAbsolute page URL whose component to serialize
compactNotoken-diet summary: node styles/text/svg/anims and the typography/paletteSummary blocks are dropped; the {tag, classes, rect} tree, fonts and colors stay
maxDepthNoMax serialized tree depth (0 = unlimited; omit for unlimited). Values above 12 risk Code Mode's 32-level response cap; 12 keeps a capped pack safe. `depthCapped:true` means deeper nodes were omitted.
maxNodesNoMax DOM nodes to serialize (default 400, clamp 50-2000)
selectorNoCSS selector of the component root (default 'header')
viewportNodesktop = 1440x900 (default); mobile = 390x844 iPhone-class with deviceScaleFactor 3, isMobile + hasTouchdesktop
publicOnlyNoRefuse private/loopback/metadata destinations and route the browser through the pinned public-address guard

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.18.0
    • addedInput schema / properties / publicOnly
      Added value: +{
      +  "description": "Refuse private/loopback/metadata destinations and route the browser through the pinned public-address guard",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changedv1.16.1
    • addedInput schema / properties / maxDepth
      Added value: +{
      +  "description": "Max serialized tree depth (0 = unlimited; omit for unlimited). Values above 12 risk Code Mode's 32-level response cap; 12 keeps a capped pack safe. `depthCapped:true` means deeper nodes were omitted.",
      +  "maximum": 64,
      +  "minimum": 0,
      +  "type": "integer"
      +}
  3. Changed1 schema field changedv1.14.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  4. Changed2 schema fields changedv1.13.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / compact / description
      Previous value: -"token-diet summary: node styles/text/svg/anims dropped; the {tag, classes, rect} tree, fonts and colors stay"New value: +"token-diet summary: node styles/text/svg/anims and the typography/paletteSummary blocks are dropped; the {tag, classes, rect} tree, fonts and colors stay"
  5. Changed1 schema field changedv1.12.0
    • addedInput schema / properties / compact
      Added value: +{
      +  "description": "token-diet summary: node styles/text/svg/anims dropped; the {tag, classes, rect} tree, fonts and colors stay",
      +  "type": "boolean"
      +}
  6. Addedv1.9.0

TDQS

A3.7/5.0
Behavior5/5

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

Beyond the readOnly/openWorld annotations, the description discloses concrete behavioral traits: sampling/truncation rules (top 12 per typography property with sampled node count, top 24 palette colours), filtering of transparent/rgba(0,0,0,0)/none values, and the response-size hazard that depths above 12 risk Code Mode's 32-level cap with depthCapped:true signalling omission. Those are non-obvious operational details an agent cannot get from annotations or schema alone.

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?

Three sentences, front-loaded with the core action and output shape before the mode/scope caveats; no filler. The parenthetical enumerations (families/sizes/weights/…) and the trailing 'does not fetch awwwards.com' clause are dense and slightly awkward, but each carries real information.

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 seven parameters, no output schema, and an open-world browser tool, the description carries the return-shape burden well by describing the pack contents, summary blocks, and caps. Gaps remain around failure behaviour (missing selector, blocked navigation) and whether the URL must be publicly reachable absent publicOnly, but nothing critical for a correct call is missing.

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 100%, so every one of the seven parameters is already documented in the schema and the baseline is 3. The description adds a little linkage value — that compact=true suppresses the typography and paletteSummary blocks it just described, tying the flag to concrete omissions — but otherwise restates the schema's compact and depth semantics.

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?

The description gives a specific verb and resource — 'Serialize a page component (structure, computed-style tokens, animations) into a portable pack for rebuild tooling' — and enumerates the payload blocks, so an agent knows exactly what it produces. It does not, however, name or contrast any sibling such as capture_live_site, analyze_page_structure, or export_design_tokens, so component-vs-page-vs-token-export selection 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 Guidelines2/5

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

There is no when-to-use guidance against the many adjacent siblings (capture_live_site, analyze_page_structure, export_design_tokens). The only routing information is the negative constraint 'does not fetch awwwards.com', which itself sits oddly next to 'Runs on any URL' and is not actionable for choosing between tools.

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