Skip to main content
Glama

autocorrect_component

Analyze and correct React components to enforce design consistency by fixing hardcoded colors, missing glass treatments, and incorrect typography tokens against active UI presets.

Instructions

Analyze a React component and auto-correct it against the active preset. Corrects: hardcoded colors, missing glass treatment, wrong typography tokens, wrong animation tokens, non-conforming sidebar/settings structure.

Args:

  • code (string): React component source code (max 10,000 chars)

  • context ('sidebar'|'settings'|'dashboard'|'surface'|'navigation'|'form'|'auto'): Component context hint for targeted rules (default: 'auto')

  • dry_run (boolean): Return issues without changing code (default: false)

Returns:

  • corrected: Fixed component code

  • issues: Array of UIIssue objects with severity, rule, message, fix

  • appliedFixes: List of changes made

  • score: Conformance score before correction (0-100)

Requires active preset (run load_preset first).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesReact component source code (max 10,000 chars)
contextNoComponent context hint for targeted rulesauto
dry_runNoReturn issues without changing code

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/ncsound919/OG-Glass'

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