Skip to main content
Glama
Tai-DT
by Tai-DT

get_shadcn_component

Retrieve shadcn/ui component source code and usage examples for React or Svelte frameworks to accelerate UI development with ready-to-use components.

Instructions

Get shadcn/ui component source code and usage examples

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentNameYesName of the shadcn/ui component (e.g., "button", "card", "form")
includeDemoNoInclude usage examples
frameworkNoFramework to get component forreact

Implementation Reference

  • The main handler function that implements the logic for the 'get_shadcn_component' tool, returning a formatted response with component details.
    export async function getComponent(args: ShadcnComponentRequest) {
      return {
        content: [
          {
            type: 'text',
            text: `Retrieved ${args.componentName} component\nFramework: ${args.framework || 'react'}\nDemo included: ${args.includeDemo || false}`
          }
        ]
      };
    }
  • src/index.ts:99-123 (registration)
    Registers the 'get_shadcn_component' tool in the TOOLS array, including its name, description, and input schema.
    {
      name: 'get_shadcn_component',
      description: 'Get shadcn/ui component source code and usage examples',
      inputSchema: {
        type: 'object',
        properties: {
          componentName: {
            type: 'string',
            description: 'Name of the shadcn/ui component (e.g., "button", "card", "form")'
          },
          includeDemo: {
            type: 'boolean',
            default: true,
            description: 'Include usage examples'
          },
          framework: {
            type: 'string',
            enum: ['react', 'svelte'],
            default: 'react',
            description: 'Framework to get component for'
          }
        },
        required: ['componentName']
      }
    },
  • src/index.ts:433-434 (registration)
    In the tool call dispatcher switch statement, maps the tool name to the getComponent handler function.
    case 'get_shadcn_component':
      return await getComponent(args as unknown as ShadcnComponentRequest);
  • TypeScript interface defining the input parameters for the get_shadcn_component tool.
    export interface ShadcnComponentRequest {
      componentName: string;
      framework?: 'react' | 'svelte';
      variant?: string;
      includeDemo?: boolean;
      customization?: Record<string, any>;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves source code and examples, implying a read-only operation, but does not specify details like authentication requirements, rate limits, error handling, or output format. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single, efficient sentence: 'Get shadcn/ui component source code and usage examples.' It is front-loaded with the core purpose, has no redundant information, and every word contributes to understanding the tool's function. This is an excellent example of conciseness.

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?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on behavioral traits, usage context, and output specifics. The high schema coverage helps, but without annotations or output schema, more completeness would be beneficial for effective agent use.

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?

The input schema has 100% description coverage, clearly documenting all three parameters. The description adds no additional semantic information beyond what the schema provides, such as examples of component names beyond 'button' or 'card', or clarification on what 'usage examples' entail. With high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

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 clearly states the tool's purpose: 'Get shadcn/ui component source code and usage examples.' It specifies the verb ('Get'), resource ('shadcn/ui component'), and what is retrieved ('source code and usage examples'). However, it does not explicitly differentiate from sibling tools like 'generate_component' or 'create_project', which might have overlapping functionality in a UI component context.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention any prerequisites, context for usage, or exclusions. Given sibling tools like 'generate_component' or 'analyze_design', the lack of differentiation leaves the agent without clear direction on tool selection.

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/Tai-DT/mcp-tailwind-gemini'

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