Skip to main content
Glama

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
NameRequiredDescriptionDefault
classTypeYes
versionNo5.x

Implementation Reference

  • 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}\``,
        }],
      };
    });

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/serbansorin/filament-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server