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}\``,
        }],
      };
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves a namespace but does not explain what the output looks like (e.g., a string, an object), whether it involves external API calls, or any error conditions. The description is minimal and lacks details on how the namespace is determined or validated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with no unnecessary words. It is front-loaded and efficiently conveys the core purpose without redundancy or fluff, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is insufficient for a tool with 2 parameters (one required) and no behavioral context. It does not explain the return value, error handling, or how the namespace is derived, leaving significant gaps for an AI agent to understand the tool's full behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, but the parameters are well-defined with enums for 'classType' and 'version'. The description does not add any semantic details beyond the schema, such as explaining what each class type represents or why the version matters. However, since the schema provides clear constraints, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and the resource ('correct namespace for a Filament class'), making the purpose understandable. It distinguishes itself from siblings by focusing on namespace retrieval rather than discovery, generation, or listing of other Filament elements. However, it could be more specific about what 'correct' means in this context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, such as needing to know the class type beforehand, or differentiate from sibling tools like 'filament_get_component' or 'filament_list_components'. Usage is implied but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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