Skip to main content
Glama

get_component_doc

Retrieve complete PrimeNG component documentation including properties, events, and methods to understand Angular UI component usage.

Instructions

Obtiene la documentación completa de un componente de PrimeNG incluyendo propiedades, eventos y métodos

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentYesNombre del componente de PrimeNG (ej: 'button', 'table', 'dialog')

Implementation Reference

  • Core handler logic: validates input, checks cache, scrapes component doc if needed, caches result, formats and returns response or error with suggestions.
    async execute(args: Record<string, any>): Promise<ToolResponse> {
      const component = args.component as string;
    
      if (!component) {
        return this.createErrorResponse('Component name is required');
      }
    
      // Check cache first
      const cachedDoc = await this.cacheService.get(component);
      if (cachedDoc) {
        logger.info(`Returning cached documentation for ${component}`);
        return this.createResponse(formatComponentDoc(cachedDoc));
      }
    
      // Scrape documentation
      try {
        const doc = await this.scraperService.scrapeComponentDoc(component);
    
        // Cache the result
        await this.cacheService.set(component, doc);
    
        return this.createResponse(formatComponentDoc(doc));
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        const suggestion = this.availableComponents.slice(0, 10).join(', ');
    
        return this.createErrorResponse(
          `Failed to get documentation for ${component}: ${errorMessage}\n\nTry one of these: ${suggestion}...`
        );
      }
    }
  • Input schema definition for the tool, specifying required 'component' parameter with enum validation.
    export function createGetComponentDocSchema(components: string[]): Tool {
      return {
        name: "get_component_doc",
        description: "Obtiene la documentación completa de un componente de PrimeNG incluyendo propiedades, eventos y métodos",
        inputSchema: {
          type: "object",
          properties: {
            component: {
              type: "string",
              description: "Nombre del componente de PrimeNG (ej: 'button', 'table', 'dialog')",
              enum: components,
            },
          },
          required: ["component"],
        },
      };
    }
  • Instantiates the GetComponentDocTool instance with dependencies.
    this.getComponentDocTool = new GetComponentDocTool(
      this.scraperService,
      this.cacheService,
      this.components
    );
  • Registers the tool schema in the MCP listTools response.
    createGetComponentDocSchema(this.components),
  • Routes tool calls matching 'get_component_doc' to the tool's run method.
    case "get_component_doc":
      return await this.getComponentDocTool.run(args);
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. While it indicates this is a read operation ('obtiene'), it doesn't describe what the output looks like (e.g., format, structure, or content details beyond 'propiedades, eventos y métodos'), potential errors, or any constraints like rate limits. For a tool with no annotations and no output schema, this leaves significant gaps in understanding how it behaves.

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 in Spanish that front-loads the core purpose without unnecessary details. It uses clear language ('obtiene la documentación completa') and specifies the included elements ('propiedades, eventos y métodos'), making it appropriately sized with zero waste.

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 (a documentation retrieval tool with no annotations and no output schema), the description is incomplete. It states what the tool does but lacks details on output format, error handling, or behavioral traits. Without annotations or an output schema, the agent has insufficient information to understand the full context of use, especially compared to siblings like 'get_component_examples'.

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 schema description coverage is 100%, with the single parameter 'component' fully documented in the schema (including description and enum values). The description adds no additional parameter semantics beyond what the schema provides, such as explaining how the component name maps to documentation or any nuances in selection. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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: 'Obtiene la documentación completa de un componente de PrimeNG incluyendo propiedades, eventos y métodos' (Gets the complete documentation of a PrimeNG component including properties, events, and methods). It specifies the verb ('obtiene'), resource ('documentación de un componente de PrimeNG'), and scope ('completa... incluyendo propiedades, eventos y métodos'). However, it doesn't explicitly differentiate from siblings like 'list_all_components' or 'get_component_examples', which would require a 5.

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 doesn't mention sibling tools like 'get_component_examples' (for examples) or 'list_all_components' (for listing components), nor does it specify prerequisites or contexts for usage. The agent must infer usage from the purpose alone, which is insufficient for clear differentiation.

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/hnkatze/PrimeNG_MCP'

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