Skip to main content
Glama

get_component

Read-only

Retrieve a component's design contract from Primitiv by name or ID: optional API, usage, or relationship details. Uses working context to resolve same-name components; returns guidance if ambiguous.

Instructions

Look up a component by name or id. Read-only, no side effects. Pass context (your current working file or directory) so same-name components resolve by path scope. Returns the component JSON (with its id) when the lookup resolves to exactly one component, or an error listing available names if not found. Detail is opt-in: pass 'api' for the component's declared prop contract, 'usage' for static JSX-site counts and observed prop values, 'relationships' for sorted outgoing uses and derived incoming usedBy counts, or 'all' for every projection. These are static source-site facts, never runtime frequency. When several components share the name and neither governance nor scope decides, returns { ambiguous, matches, instruction } — follow the instruction: match each candidate's rationale.when against the user's intent, and if that doesn't decide, ask the user; never pick arbitrarily. Use this when you need implementation details for a known component to reuse it rather than recreate it. For a list of all components, use get_design_context with category 'components' instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
detailNo
contextNo
Behavior5/5

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

Even though the readOnlyHint annotation already signals safety, the description goes well beyond it by disclosing exact resolution behavior: same-name resolution by context path scope, error behavior when not found, the meaning of each detail projection, and the static-source-facts caveat. It also precisely describes the ambiguous-match response shape with { ambiguous, matches, instruction } and instructs the agent to follow the instruction rather than pick arbitrarily.

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?

The description is dense but every sentence adds distinct value: purpose, read-only guarantee, context semantics, return behavior, detail options, static facts caveat, ambiguity protocol, and usage alternative. It is front-loaded with the core lookup purpose and then layers essential behavioral details without redundancy.

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

Completeness5/5

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

Given there is no output schema, the description thoroughly explains return values, error cases, ambiguity handling, and parameter behaviors. It covers all necessary contingencies for correct invocation and interpretation, including how to disambiguate by rationale.when and when to ask the user. The description is complete for a tool of this complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden, and it succeeds. It explains that 'name' can be either a name or id, that 'context' is used for path-scoped resolution of same-name components, and it defines each enum value of 'detail' with concrete projections. This adds substantial meaning beyond the bare schema types and enum list.

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 looks up a component by name or id, with an explicit read-only guarantee. It differentiates itself from the sibling get_design_context by noting that the sibling provides the list of all components. The verb 'look up' plus the resource 'component' makes the purpose unmistakable.

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

Usage Guidelines5/5

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

The description gives explicit when-to-use guidance: use this tool when you need implementation details for a known component to reuse rather than recreate it. It also names the alternative get_design_context for listing all components, preventing misuse. The ambiguity-resolution instructions further guide the agent on what to do when lookup returns multiple matches.

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/AI-by-design/primitiv'

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