Skip to main content
Glama

get_doc_structure

Retrieve the structure of available Laravel documentation files to navigate and access development resources efficiently.

Instructions

Get the structure of all available documentation files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • index.js:62-94 (registration)
    Tool registration for 'get_doc_structure' with schema and handler. The registration defines the tool name, description, empty input schema (no parameters required), and the async handler function that executes the tool logic.
    server.registerTool(
      'get_doc_structure',
      {
        description: 'Get the structure of all available documentation files',
        inputSchema: {},
      },
      async () => {
        const files = getDocFiles(DOCS_PATH);
    
        const structure = {
          documentation_root: DOCS_PATH,
          files: files.map(f => ({
            path: f.path,
            name: f.name,
          })),
          summary: {
            total_files: files.length,
            categories: {
              ai: files.filter(f => f.path.startsWith('ai/')).length,
              patterns: files.filter(f => f.path.startsWith('patterns/')).length,
              domains: files.filter(f => f.path.startsWith('domains/')).length,
            },
          },
        };
    
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(structure, null, 2),
          }],
        };
      }
    );
  • index.js:68-93 (handler)
    Handler function for get_doc_structure tool. It calls getDocFiles(DOCS_PATH) to retrieve all markdown files, constructs a structure object with documentation_root, files array, and summary containing total_files count and category breakdown (ai, patterns, domains), then returns the result as JSON text content.
    async () => {
      const files = getDocFiles(DOCS_PATH);
    
      const structure = {
        documentation_root: DOCS_PATH,
        files: files.map(f => ({
          path: f.path,
          name: f.name,
        })),
        summary: {
          total_files: files.length,
          categories: {
            ai: files.filter(f => f.path.startsWith('ai/')).length,
            patterns: files.filter(f => f.path.startsWith('patterns/')).length,
            domains: files.filter(f => f.path.startsWith('domains/')).length,
          },
        },
      };
    
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(structure, null, 2),
        }],
      };
    }
  • Helper function getDocFiles that recursively scans a directory to find all markdown files. It skips hidden directories and node_modules, returns an array of file objects containing relative path, full path, and filename. This is used by get_doc_structure to build the file structure.
    function getDocFiles(dir, basePath = dir) {
      const files = [];
    
      if (!fs.existsSync(dir)) {
        return files;
      }
    
      const entries = fs.readdirSync(dir, { withFileTypes: true });
    
      for (const entry of entries) {
        const fullPath = path.join(dir, entry.name);
        const relativePath = path.relative(basePath, fullPath);
    
        if (entry.isDirectory()) {
          // Skip node_modules and hidden directories
          if (!entry.name.startsWith('.') && entry.name !== 'node_modules') {
            files.push(...getDocFiles(fullPath, basePath));
          }
        } else if (entry.name.endsWith('.md')) {
          files.push({
            path: relativePath,
            full_path: fullPath,
            name: entry.name,
          });
        }
      }
    
      return files;
    }
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 action but doesn't describe what 'structure' means (e.g., hierarchical layout, metadata), whether it's a read-only operation, potential rate limits, or the response format. This leaves significant gaps for a tool with no annotation coverage.

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, efficient sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded and wastes no space, making it easy for an agent to parse quickly.

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

Completeness3/5

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

Given the tool has 0 parameters, no annotations, and no output schema, the description is minimally adequate but lacks depth. It doesn't explain what 'structure' entails or provide behavioral context, which could be important for documentation retrieval. However, the simplicity of the tool (no inputs) reduces the need for extensive detail.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, but that's appropriate given the schema's completeness. A baseline of 4 is applied as it adequately handles the lack of parameters.

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 verb 'Get' and the resource 'structure of all available documentation files', making the purpose understandable. However, it doesn't specifically differentiate this tool from sibling tools like 'get_design_system' or 'read_doc', which might also relate to documentation access.

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 like 'search_docs' or 'read_doc'. It lacks any context about prerequisites, timing, or exclusions, leaving the agent to infer usage based on the name alone.

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/pujandan/mcp-laravel'

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