Skip to main content
Glama

Component code

get_component
Read-only

Retrieve a UI component's code, dependencies, and install command by name to add it to your project; in shadcn projects, run the provided install command.

Instructions

Returns a component's code, dependencies and install command. In a project that already uses shadcn, prefer running the install command.

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

Input Schema

NameRequiredDescriptionDefault
nameYesName as returned by search_components, e.g. button, BlurText-TS-TW, text-effect
registryNoshadcn

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.8/5.0
Behavior3/5

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

With readOnlyHint and openWorldHint already declared, the description's contribution is disclosing the return contents and the fact that an install command is included, which matters because there is no output schema. It stops short of describing what a remote registry fetch implies (network dependency, failures, whether code is cached or generated per call), which the openWorldHint invites.

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 short sentences: what is returned first, then the usage caveat. Nothing is padded and the ordering is front-loaded correctly.

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 read tool with no output schema, listing the returned artifacts covers the main unknown. The one remaining hole is the registry parameter's meaning, which is neither in the schema nor the description.

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 50%: `name` is well documented in the schema, while `registry` only has an enum and default with no explanation. The description's shadcn reference implicitly signals the default registry but never explains what reactbits, motion-primitives, or fancy yield differently, so it only partially compensates.

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 gives a specific verb and resource ("Returns a component's code") and enumerates the payload (code, dependencies, install command), so an agent knows exactly what it gets back. It is clearly distinct from retrieval tools like search_components or get_icon, though it does not name a sibling explicitly to sharpen the contrast.

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?

"In a project that already uses shadcn, prefer running the `install` command" is a concrete when-not-to-use condition, which is more than most getter definitions offer. The gap is that it points outside the toolset rather than routing between sibling tools (e.g., search first, then fetch), and nothing is said about when the registry variants are worth choosing.

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