filament_get_component
Retrieve detailed information about Filament components to understand their properties, usage, and implementation in Laravel admin panels.
Instructions
Get detailed information about a Filament component
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| component | Yes | Component name (e.g., TextInput, Select) | |
| version | No | 5.x |
Implementation Reference
- src/tools/index.ts:58-70 (handler)The handler implementation for the "filament_get_component" tool, which searches for a component in the Filament reference data and returns details.
server.tool("filament_get_component", "Get detailed information about a Filament component", { component: componentSchema, version: versionSchema, }, async ({ component, version }) => { const reference = version === "4.x" ? filamentV4Reference : filamentV5Reference; for (const category of reference.categories) { const found = category.components.find(c => c.name.toLowerCase() === component.toLowerCase()); if (found) { return { content: [{ type: "text", text: `# ${found.name}\n\n**Namespace:** \`${found.namespace}\`\n\n**Description:** ${found.description}\n\n**Docs:** ${found.docsUrl}\n\n**Examples:**\n\`\`\`php\n${found.examples?.join("\n") || "None"}\n\`\`\`` }] }; } } return { content: [{ type: "text", text: `Component "${component}" not found.` }] }; }); - src/tools/index.ts:7-9 (schema)Schema definitions for the "filament_get_component" tool inputs.
const versionSchema = z.enum(["4.x", "5.x"]).default("5.x"); const componentSchema = z.string().min(1).describe("Component name (e.g., TextInput, Select)"); const descriptionSchema = z.string().min(5).describe("What you want to build"); - src/tools/index.ts:58-58 (registration)Tool registration for "filament_get_component" within the registerFilamentTools function.
server.tool("filament_get_component", "Get detailed information about a Filament component", {