Skip to main content
Glama

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: [], },

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