Skip to main content
Glama

Validate AI Canvas component usage in a file

validate_usage
Read-onlyIdempotent

Validates JSX against AI Canvas component prop definitions, flagging unknown props, missing required props, and invalid option strings with line numbers.

Instructions

Check a file's JSX against the documented props of the AI Canvas components it imports. Reports props that do not exist on the component, required props that are missing, and string values outside a prop's allowed options, each with a line number. Run it on every file that uses AI Canvas components before you finish. Components are matched by import path (components/aicanvas/ for standalones, components/aicanvas//... for design-system components); pass tags to map a tag to a slug by hand.

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": {
      "code": "<code>"
    },
    "name": "validate_usage"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesThe full contents of the file to check.
pathNoThe file path, used only in the report.
tagsNoOptional map from JSX tag name to registry slug, e.g. { "Button": "andromeda-button-system" }, for tags the import scan cannot resolve.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.2

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/openWorld, and the description adds real substance: the shape of the report (unknown props, missing required props, out-of-range string values, each with a line number) and how components are resolved by import path. It stops short of describing behavior on unresolvable tags or parse failures, which would have earned a 5.

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?

Three sentences: the what, the required workflow, then the resolution mechanics. Front-loaded and dense, with no filler; the last sentence earns its length by clarifying how matching and the tags escape hatch work.

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?

For a 3-parameter, read-only checker with no output schema, the description supplies what an agent needs: what is validated, what the report contains, and how components are matched. Edge-case behavior (invalid syntax, zero components found) is the only notable omission.

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 the 3 baseline is met by the schema alone. The description goes further by explaining the import-path conventions used for matching (components/aicanvas/<slug> vs <system>/...) and the hand-mapping purpose of `tags`; `code` and `path` get no extra treatment but are self-evident.

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?

Specific verb plus resource: “Check a file's JSX against the documented props of the AI Canvas components it imports,” and it enumerates the three report categories. It doesn't explicitly name a sibling (e.g. get_component_props) to contrast against, so it falls short of the top mark, but the validator role is unambiguous.

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?

“Run it on every file that uses AI Canvas components before you finish” gives an explicit trigger and timing. There are no exclusivity rules or when-not-to-use conditions (e.g. when a file imports no components, or when to rely on get_component_props instead).

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