Skip to main content
Glama

read_directory

List files and folders in a directory to explore the file structure within accessible roots for architectural decision record analysis.

Instructions

List files and folders in a directory. Use this to explore the file structure within accessible roots.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesDirectory path to list (relative to project root or absolute within roots)

Implementation Reference

  • Registers the 'read_directory' tool in the central TOOL_CATALOG with full metadata including input schema (path: string required, recursive: boolean optional). Used for dynamic tool discovery, MCP ListTools responses, and search_tools meta-tool.
    TOOL_CATALOG.set('read_directory', {
      name: 'read_directory',
      shortDescription: 'Read directory contents',
      fullDescription: 'Lists contents of a directory.',
      category: 'file-system',
      complexity: 'simple',
      tokenCost: { min: 100, max: 1000 },
      hasCEMCPDirective: true, // Phase 4.3: Simple tool - directory read
      relatedTools: ['read_file', 'list_directory'],
      keywords: ['directory', 'read', 'list'],
      requiresAI: false,
      inputSchema: {
        type: 'object',
        properties: {
          path: { type: 'string', description: 'Path to directory' },
          recursive: { type: 'boolean', default: false },
        },
        required: ['path'],
      },
    });
  • Defines the input schema and complete metadata for the read_directory tool, including description 'Read directory contents and metadata', category 'file-system', and no AI requirement.
    TOOL_CATALOG.set('read_directory', {
      name: 'read_directory',
      shortDescription: 'Read directory contents',
      fullDescription: 'Lists contents of a directory.',
      category: 'file-system',
      complexity: 'simple',
      tokenCost: { min: 100, max: 1000 },
      hasCEMCPDirective: true, // Phase 4.3: Simple tool - directory read
      relatedTools: ['read_file', 'list_directory'],
      keywords: ['directory', 'read', 'list'],
      requiresAI: false,
      inputSchema: {
        type: 'object',
        properties: {
          path: { type: 'string', description: 'Path to directory' },
          recursive: { type: 'boolean', default: false },
        },
        required: ['path'],
      },
    });
  • Lists 'read_directory' tool in the hardcoded server context generation for LLM awareness, under File System Operations category.
    { name: 'read_directory', description: 'Read directory contents and metadata' },

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/tosin2013/mcp-adr-analysis-server'

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