Skip to main content
Glama
Nikhilreddy1011

@21st-dev/magic

21st_magic_component_refiner

Refine React UI components by applying targeted design improvements and returning redesigned code with implementation instructions.

Instructions

"Use this tool when the user requests to re-design/refine/improve current UI component with /ui or /21 commands, or when context is about improving, or refining UI for a React component or molecule (NOT for big pages). This tool improves UI of components and returns redesigned version of the component and instructions on how to implement it."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextYesExtract the specific UI elements and aspects that need improvement based on user messages, code, and conversation history. Identify exactly which components (buttons, forms, modals, etc.) the user is referring to and what aspects (styling, layout, responsiveness, etc.) they want to enhance. Do not include generic improvements - focus only on what the user explicitly mentions or what can be reasonably inferred from the available context. If nothing specific is mentioned or you cannot determine what needs improvement, return an empty string.
userMessageYesFull user's message about UI refinement
absolutePathToRefiningFileYesAbsolute path to the file that needs to be refined
Install Server

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden. It does state the core outcome—'returns redesigned version of the component and instructions on how to implement it'—which implies a read/return behavior rather than a direct write. However, it never says whether the file at absolutePathToRefiningFile is modified, what happens on failure, or any prerequisites, leaving the side-effect profile unclear for a mutating-looking 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?

Two compact sentences with the trigger condition front-loaded in the opening clause ('Use this tool when...'). There is minor redundancy—'improves UI' appears in both sentences—but no filler or irrelevant content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The definition covers what the tool does, when to use it, and the outcome, and the schema fully documents parameters. But with no output schema and no annotations, the concrete return format of the 'redesigned version and instructions' is unspecified, and side effects on the target file are unstated, leaving the full invocation contract incomplete.

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%, and the schema already documents all three parameters in detail—'context' even includes extraction rules and the 'return an empty string' fallback. The description text adds no parameter-level meaning beyond the schema, so the baseline 3 applies.

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 states specific verbs ('re-design/refine/improve') and a clear resource ('current UI component', 'React component or molecule'), and scopes the tool by excluding big pages. The outcome is also specified: it 'returns redesigned version of the component and instructions on how to implement it.' It does not explicitly distinguish itself from sibling tools (inspiration, builder), so differentiation is inferable rather than stated.

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?

Explicit trigger conditions are given ('when the user requests to re-design/refine/improve current UI component with /ui or /21 commands, or when context is about improving, or refining UI for a React component or molecule') plus a clear exclusion ('NOT for big pages'). It stops short of naming alternatives—an agent is not told to use builder for new components or inspiration for ideas—so the when-not guidance is partial.

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

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/Nikhilreddy1011/magic-mcp'

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