filament_get_namespace
Retrieve the correct namespace for Filament classes like models, resources, and components to ensure proper implementation in Laravel Filament admin panels.
Instructions
Get the correct namespace for a Filament class
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| classType | Yes | ||
| version | No | 5.x |
Implementation Reference
- src/tools/index.ts:82-103 (handler)The tool implementation for 'filament_get_namespace', which retrieves the namespace for a given Filament class and version from the `namespaceMap`.
server.tool("filament_get_namespace", "Get the correct namespace for a Filament class", { classType: namespaceClassTypeSchema, version: versionSchema, }, async ({ classType, version }) => { const namespace = namespaceMap[classType]?.[version] ?? null; if (!namespace) { return { content: [{ type: "text", text: `# Namespace for ${classType}\n\nNot available in Filament ${version}.`, }], }; } return { content: [{ type: "text", text: `# Namespace for ${classType}\n\nVersion: ${version}\nNamespace: \`${namespace}\``, }], }; });