search_components
Find PrimeNG UI components by searching with keywords like 'input', 'table', or 'menu' to locate the right Angular components for your project needs.
Instructions
Busca componentes de PrimeNG que coincidan con una consulta
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Término de búsqueda (ej: 'input', 'table', 'menu') |
Implementation Reference
- src/tools/SearchComponentsTool.ts:8-29 (handler)Core implementation of the search_components tool. The SearchComponentsTool class extends BaseTool and provides the execute method that performs filtering of available components based on the input query and formats the results.export class SearchComponentsTool extends BaseTool { private availableComponents: string[]; constructor(availableComponents: string[]) { super('search_components'); this.availableComponents = availableComponents; } async execute(args: Record<string, any>): Promise<ToolResponse> { const query = args.query as string; if (!query) { return this.createErrorResponse('Search query is required'); } const results = this.availableComponents.filter(comp => comp.toLowerCase().includes(query.toLowerCase()) ); return this.createResponse(formatSearchResults(results, query)); } }
- src/models/ToolSchemas.ts:28-46 (schema)Schema definition for the search_components tool, including input schema with required 'query' string parameter./** * Creates the schema for search_components tool */ export function createSearchComponentsSchema(): Tool { return { name: "search_components", description: "Busca componentes de PrimeNG que coincidan con una consulta", inputSchema: { type: "object", properties: { query: { type: "string", description: "Término de búsqueda (ej: 'input', 'table', 'menu')", }, }, required: ["query"], }, }; }
- src/server/PrimeNGServer.ts:208-209 (registration)Tool dispatch registration in the CallToolRequestSchema handler's switch statement, calling the tool's run method.case "search_components": return await this.searchComponentsTool.run(args);
- src/server/PrimeNGServer.ts:182-182 (registration)Registration of the tool schema in the listTools response (tools array).createSearchComponentsSchema(),
- src/server/PrimeNGServer.ts:139-139 (registration)Instantiation of the SearchComponentsTool instance in the server's initializeTools method.this.searchComponentsTool = new SearchComponentsTool(this.components);