Skip to main content
Glama

get_component_code

Retrieve complete React, Tailwind, and Framer Motion source code, demo, and dependencies for any component. Fetches live from registry if not found offline.

Instructions

Retrieves complete React, Tailwind, Framer Motion source code, demo, and dependencies for a component. Supports fallback live fetching.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesUnique component slug e.g. 'glowing-card', 'floating-dock', 'bento-grid-3x3'
registryUrlNoOptional 21st.dev registry URL to fetch live if not found offline

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.8.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It states that the tool retrieves multiple artifact types and supports fallback live fetching, which conveys a read-only, network-capable operation. It does not detail error behavior, but for a simple retrieval tool the core behavior is transparent enough.

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?

Two concise sentences front-load the core purpose and add the fallback behavior without any filler. Every clause contributes useful 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?

For a two-parameter retrieval tool with no output schema, the description sufficiently explains what will be returned and the fallback mechanism. It lacks only minor details like error behavior or exact response structure, but the essential calling context is covered.

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 coverage is 100%, so the schema already documents both slug and registryUrl. The description adds minimal parameter-level meaning beyond noting fallback live fetching, which aligns with the registryUrl schema description. Baseline 3 is appropriate because the description does not need to compensate.

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 names a specific verb ('Retrieves') and a concrete resource ('complete React, Tailwind, Framer Motion source code, demo, and dependencies for a component'). This clearly distinguishes it from sibling tools like search_ui_components, which search rather than retrieve code.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

The description implies the tool is used when you need source code for a specific component, but it gives no explicit when-to-use or when-not-to-use guidance, nor does it mention alternatives such as search_ui_components for discovering a slug. Usage context is implied rather than stated.

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