components-filter
Filter and retrieve shadcn/ui components with Tailwind CSS based on specific requirements. Simplify UI development by processing structured input to identify relevant components.
Instructions
filter components with shadcn/ui components and tailwindcss, Use this tool when mentions /filter
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | requirement json from requirement-structuring tool |
Implementation Reference
- src/core/tools.ts:82-107 (registration)Registration of the 'components-filter' tool, including name, description, schema, and handler.server.addTool({ name: "components-filter", description: "filter components with shadcn/ui components and tailwindcss, Use this tool when mentions /filter", parameters: z.object({ message: z.string().describe("requirement json from requirement-structuring tool"), }), execute: async (params) => { try { // 将筛选任务和数据传给 IDE 的 AI 处理 const filteringPrompt = `${getFilterComponentsPrompt(params.message)}\nAfter outputting the json, call the component-builder tool`; return { content: [ { type: "text", text: filteringPrompt, }, ], }; } catch (error) { console.error("Error executing tool:", error); throw error; } }, });
- src/core/tools.ts:86-88 (schema)Zod schema defining the input parameter 'message' for the tool.parameters: z.object({ message: z.string().describe("requirement json from requirement-structuring tool"), }),
- src/core/tools.ts:89-106 (handler)Handler function that generates a prompt using getFilterComponentsPrompt and returns it as text content for AI processing.execute: async (params) => { try { // 将筛选任务和数据传给 IDE 的 AI 处理 const filteringPrompt = `${getFilterComponentsPrompt(params.message)}\nAfter outputting the json, call the component-builder tool`; return { content: [ { type: "text", text: filteringPrompt, }, ], }; } catch (error) { console.error("Error executing tool:", error); throw error; } },