get_item

Lightweight metadata for one registry item — title, description, premium flag, dependencies, file paths. Excludes source code. The cheap-to-browse retrieval tool.

get_item returns everything the agent needs to reason about a component without downloading its full source. Use it to shortlist candidates before paying the token cost of get_item_source.

When to use

  • The agent has a slug (from search_items, list_items, or list_blocks_in_category) and wants to know: is it premium? what does it depend on? how many files? which path does it install to?
  • Comparing multiple candidates before picking one.
  • Answering "what does X need?" questions.

If the agent has already committed and wants the source, skip straight to get_item_source.

How it works

  1. Calls getRegistryItem(name) — a universal resolver in services/registry.ts that probes slugs against every surface in priority order:

    1. Icons (if the name contains a hyphen and matches a library prefix)
    2. Blocks (scans all 56 block categories)
    3. Patterns (scans packages/examples/*/*)
    4. Hooks (if name starts with use-)
    5. Themes → AI → Charts → Buttons → Shaders → Backgrounds
    6. Consolidated components (packages/components/*/)
    7. General components (packages/*/)

    The first match wins. Returns null if nothing resolves.

  2. The returned RegistryItem is mapped to a "lite" form: everything preserved except each files[i].content is stripped (paths and targets remain).

  3. JSDoc metadata (@title, @description, @premium) has already been parsed into the top-level title, description, premium fields by the resolver.

Source: lib/mcp/tools.ts#get_item + services/registry.ts#getRegistryItem.

Arguments

NameTypeRequiredNotes
namestringSlug — e.g. hero-announcement, pricing-grouped-comparison-table, use-debounce

Response

{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pricing-grouped-comparison-table",
  "type": "registry:block",
  "title": "React Grouped Comparison Table Pricing Block",
  "description": "A pricing block using a grouped feature comparison table layout for tiered SaaS plans.",
  "author": "shadcn.io",
  "homepage": "https://www.shadcn.io/blocks/pricing-grouped-comparison-table",
  "premium": true,
  "dependencies": ["lucide-react"],
  "registryDependencies": ["button", "badge"],
  "files": [
    {
      "path": "blocks/pricing/pricing-grouped-comparison-table.tsx",
      "type": "registry:block",
      "target": "components/blocks/pricing/pricing-grouped-comparison-table.tsx"
    }
  ]
}

Key fields:

  • premiumtrue if the JSDoc has @premium true. Non-Pro users get 403 with redacted content when they try to install this (but they can still call get_item to see the metadata).
  • dependencies — npm packages to install alongside (lucide-react, recharts, etc.). Inferred from import statements.
  • registryDependencies — other shadcn registry items this depends on (button, badge). The shadcn add CLI will install these transitively.
  • files[].target — where the file will land on install.

For an unknown slug:

{
  "content": [{ "type": "text", "text": "Registry item not found: nonexistent-slug" }],
  "isError": true
}

Example prompts

use shadcnio to tell me what pricing-grouped-comparison-table depends on
use shadcnio and check if hero-announcement is a premium block
use shadcnio to list the registryDependencies for the first 5 pricing blocks so I know which primitives I'll need

Manual invocation

curl -s -X POST "https://www.shadcn.io/api/mcp?token=YOUR_TOKEN" \
  -H "content-type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "get_item",
      "arguments": { "name": "pricing-grouped-comparison-table" }
    }
  }' | jq '.result.content[0].text | fromjson'

Tips + gotchas

  • Resolution order matters — if a slug could match both an icon and a block, icons win. In practice this only bites for icons (which must be formatted {libraryId}-{iconName}).
  • Premium status is safe to expose — free and Pro users alike can call get_item and see that a block is premium. Only get_item_source enforces Pro for premium content.
  • Dependencies are inferred, not curated — the resolver greps the source for known package names (see extractDependencies in services/registry.ts). It's mostly right, but exotic imports can be missed. shadcn add will still fail loudly if a dep is actually required.
  • No paginationget_item returns the full metadata object every time. There's no way to narrow it further.

Was this page helpful?

Sign in to leave feedback.