Skip to main content
Glama
exoticknight

File Merger MCP Server

list_allowed_directories

Retrieve the list of directories accessible by the File Merger MCP Server. Use this to verify permitted paths before initiating file merge operations.

Instructions

Returns the list of directories that this server is allowed to access. Use this to understand which directories are available before trying to merge files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler implementation for the 'list_allowed_directories' tool. Returns a text response listing the allowed directories or a message indicating no restrictions.
    case "list_allowed_directories": {
      return {
        content: [{
          type: "text",
          text: allowedDirectories.length > 0
            ? `Allowed directories:\n${allowedDirectories.join('\n')}`
            : "No directory restrictions - all directories are allowed"
        }],
      };
    }
  • src/index.ts:110-120 (registration)
    Registration of the 'list_allowed_directories' tool in the ListToolsRequestHandler, including name, description, and empty input schema.
    {
      name: "list_allowed_directories",
      description:
        "Returns the list of directories that this server is allowed to access. " +
        "Use this to understand which directories are available before trying to merge files.",
      inputSchema: {
        type: "object",
        properties: {},
        required: [],
      },
    },
  • Initialization and validation of the 'allowedDirectories' array from command-line arguments, which is used by the 'list_allowed_directories' tool.
    const args = process.argv.slice(2);
    let allowedDirectories: string[] = [];
    
    if (args.length > 0) {
      allowedDirectories = args.map(dir => path.resolve(dir));
    
      // Validate directories if specified
      for (const dir of allowedDirectories) {
        try {
          const stats = await fs.stat(dir);
          if (!stats.isDirectory()) {
            console.error(`Error: ${dir} is not a directory`);
            process.exit(1);
          }
        } catch (error) {
          console.error(`Error accessing directory ${dir}:`, error);
          process.exit(1);
        }
      }
    } else {
      // Default to current directory if no arguments provided
      allowedDirectories = [process.cwd()];
    }
  • Input schema for the 'list_allowed_directories' tool, which requires no parameters (empty object).
    inputSchema: {
      type: "object",
      properties: {},
      required: [],
    },
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the tool's read-only nature by stating it 'returns' data, but lacks details on permissions, rate limits, or response format. It adds some context about server access constraints, but behavioral traits are minimally covered.

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?

Two sentences with zero waste: the first states the purpose, the second provides usage guidance. It is front-loaded with the core functionality and efficiently structured.

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

Completeness4/5

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

For a simple read-only tool with no parameters and no output schema, the description is mostly complete—it explains what the tool does and when to use it. However, it lacks details on return format or error handling, leaving minor gaps in full contextual understanding.

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 tool has 0 parameters with 100% schema coverage, so no parameter documentation is needed. The description appropriately focuses on purpose and usage without redundant parameter details, meeting the baseline for zero-parameter tools.

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

Purpose5/5

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

The description clearly states the specific action ('Returns the list of directories') and resource ('that this server is allowed to access'), distinguishing it from the sibling tool 'merge_files' by focusing on directory discovery rather than file operations.

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

Usage Guidelines5/5

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

Explicitly states when to use this tool ('before trying to merge files') and provides a clear alternative context, guiding the agent to use it for preparatory directory discovery rather than file manipulation.

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

Related 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/exoticknight/mcp-file-merger'

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