Skip to main content
Glama

get_component_doc

Retrieve complete PrimeNG component documentation including properties, events, and methods for Angular UI development.

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

  • The execute method implements the core logic of the get_component_doc tool: validates input, checks cache, scrapes documentation if needed, caches result, and formats output.
    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}...` ); } }
  • Defines the input schema for the get_component_doc tool, including component name with enum validation from available components.
    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 required services and components list during server initialization.
    this.getComponentDocTool = new GetComponentDocTool( this.scraperService, this.cacheService, this.components );
  • Registers the dynamic schema for get_component_doc in the MCP list tools response.
    createGetComponentDocSchema(this.components),
  • Handles incoming calls to get_component_doc by invoking the tool's run method.
    case "get_component_doc": return await this.getComponentDocTool.run(args);

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