Skip to main content
Glama

validate_component_code

Validates agent-generated web component code using 19 anti-hallucination sub-validators for HTML attributes, accessibility, CSS, and more. Returns anti-pattern examples and fix suggestions to ensure code quality before submission.

Instructions

ALL-IN-ONE validator — runs 19 anti-hallucination sub-validators on agent-generated code in a single call. Validates HTML attributes, slot children, attribute conflicts, a11y patterns, Shadow DOM CSS, custom properties, token fallbacks, theme compatibility, CSS specificity, layout patterns, inline styles, event bindings, method calls, composition patterns, component imports, color contrast, CSS scope, shorthand safety, and transition/animation patterns. Returns antiPatterns (component-specific negative examples) and auto-generated fix suggestions on issues. Use this as the FINAL check before submitting any code that uses web components.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
libraryIdNoOptional library ID to target a specific loaded library instead of the default.
htmlYesThe HTML markup to validate.
cssNoOptional CSS code to validate for Shadow DOM and custom property issues.
codeNoOptional JS/JSX/template code to validate event bindings.
tagNameYesThe primary custom element tag name to validate against.
frameworkNoOptional framework hint for event validation.
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It lists all validated aspects and states the output includes antiPatterns and fix suggestions. It does not mention side effects or limitations, but it is sufficiently transparent for a validation tool.

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?

The description is structured and front-loaded with the purpose. It lists validations efficiently and provides output details. While slightly verbose, it earns its sentences without redundancy.

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?

Given the tool's complexity (6 parameters, many sibling tools, no output schema), the description covers the validation scope and output format well. It lacks details on return value structure or performance considerations, but overall it is complete enough for selection.

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%, setting a baseline of 3. The description does not add significant meaning beyond the schema; it only indirectly references parameters through the validated items. It meets the baseline but does not exceed it.

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?

The description clearly states the tool's purpose: an all-in-one validator for agent-generated code, listing 19 specific sub-validators. It distinguishes itself from sibling tools by being a comprehensive final check rather than a focused validator.

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 description explicitly says 'Use this as the FINAL check before submitting any code that uses web components.' This provides clear when-to-use guidance. It does not explicitly mention when not to use it or name alternatives, but the sibling tools are specific checks, so the context is clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bookedsolidtech/helixir'

If you have feedback or need assistance with the MCP directory API, please join our Discord server