Skip to main content
Glama
A-Niranjan

MCP Filesystem Server

by A-Niranjan

list_allowed_directories

Check which directories are accessible before performing file operations in the MCP Filesystem Server. This tool helps verify available paths to ensure secure and valid file access.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_allowed_directories' tool. It logs a debug message, ends the metric timer, and returns a text content listing all allowed directories from the server configuration.
    case 'list_allowed_directories': { await logger.debug('Listed allowed directories') endMetric() return { content: [ { type: 'text', text: `Allowed directories:\n${config.allowedDirectories.join('\n')}`, }, ], } }
  • src/index.ts:325-335 (registration)
    Registration of the 'list_allowed_directories' tool in the ListTools response, including its name, description, and empty input schema (no parameters required).
    { 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 access files.', inputSchema: { type: 'object', properties: {}, required: [], }, },
  • Input schema for the 'list_allowed_directories' tool, which is an empty object since the tool takes no parameters.
    inputSchema: { type: 'object', properties: {}, required: [], },

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/A-Niranjan/mcp-filesystem'

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