Skip to main content
Glama

get_component_docs

Retrieve component documentation, usage examples, and prop descriptions for its-just-ui React components to aid development and implementation.

Instructions

Get documentation, usage examples, and prop descriptions for a component

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentYesComponent name
sectionNo

Implementation Reference

  • Core handler function that retrieves the component from the registry and generates the appropriate documentation section based on the input parameters.
    getComponentDocs(componentName: string, section?: string): string {
      const component = componentRegistry.getComponent(componentName);
    
      if (!component) {
        return `Component "${componentName}" not found. Available components: ${Object.keys(
          componentRegistry.listComponents("all"),
        ).join(", ")}`;
      }
    
      if (!section || section === "usage") {
        return this.getUsageDoc(component);
      }
    
      switch (section) {
        case "props":
          return this.getPropsDoc(component);
        case "examples":
          return this.getExamplesDoc(component);
        case "accessibility":
          return this.getAccessibilityDoc(component);
        default:
          return this.getUsageDoc(component);
      }
    },
  • Zod schema defining the input parameters for the get_component_docs tool: component name (required) and optional section.
    const GetComponentDocsSchema = z.object({
      component: z.string().describe("Component name to get documentation for"),
      section: z.enum(["usage", "props", "examples", "accessibility"]).optional(),
    });
  • src/index.ts:323-338 (registration)
    Tool registration entry in the listTools response, providing the tool name, description, and input schema for MCP discovery.
    {
      name: "get_component_docs",
      description:
        "Get documentation, usage examples, and prop descriptions for a component",
      inputSchema: {
        type: "object",
        properties: {
          component: { type: "string", description: "Component name" },
          section: {
            type: "string",
            enum: ["usage", "props", "examples", "accessibility"],
          },
        },
        required: ["component"],
      },
    },
  • Dispatcher case in the main CallToolRequest handler that validates input with the schema and invokes the documentationTools.getComponentDocs function.
    case "get_component_docs": {
      const { component, section } = GetComponentDocsSchema.parse(args);
      const docs = documentationTools.getComponentDocs(component, section);
      return {
        content: [
          {
            type: "text",
            text: docs,
          },
        ],
      };
    }
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 information ('Get'), implying it's a read-only operation, but doesn't specify any behavioral traits such as authentication requirements, rate limits, error handling, or what happens if the component doesn't exist. This leaves significant gaps in understanding how the tool behaves in practice.

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 that directly states the tool's purpose without any unnecessary words. It is front-loaded and to the point, making it easy to parse quickly. Every part of the sentence contributes to understanding what the tool does, earning its place.

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

Completeness2/5

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

Given the complexity of a tool with 2 parameters (one required, one with enum), no annotations, and no output schema, the description is insufficient. It lacks details on return values, error conditions, and how the 'section' parameter affects the output. For a tool that retrieves structured documentation, more context is needed to ensure the AI agent can use it correctly without guesswork.

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 description mentions 'documentation, usage examples, and prop descriptions for a component,' which loosely relates to the 'component' parameter and hints at the 'section' parameter's purpose. However, with 50% schema description coverage (only 'component' has a description), the 'section' parameter's semantics are not elaborated beyond the enum values. The description adds some context but doesn't fully compensate for the coverage gap, aligning with the baseline for moderate schema coverage.

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 documentation, usage examples, and prop descriptions for a component.' It specifies the verb ('Get') and resource ('documentation, usage examples, and prop descriptions for a component'), making it easy to understand what the tool does. However, it does not explicitly differentiate from sibling tools like 'list_components' or 'check_accessibility', which slightly limits its clarity in a broader 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, exclusions, or specific contexts for usage. For example, it doesn't clarify if this is for retrieving pre-existing documentation or generating it, or how it differs from 'list_components' or 'check_accessibility'. This lack of contextual guidance makes it harder for an AI agent to select the right tool.

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/its-just-ui/its-just-mcp'

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