list_allowed_directories
Retrieve a list of directories accessible through the MCP Filesystem Server. Use this tool to verify permitted directories before attempting file operations or command execution.
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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:707-719 (handler)The handler function for the 'list_allowed_directories' tool. It logs a debug message and returns the list of allowed directories from the config, formatted as a text response.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 handler. Includes the tool 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: [], }, },
- src/index.ts:331-334 (schema)Input schema for the 'list_allowed_directories' tool, defined as an empty object since the tool requires no input parameters.type: 'object', properties: {}, required: [], },