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
| 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, 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: [], }, },
- src/index.ts:330-334 (schema)Input schema for the 'list_allowed_directories' tool, which is an empty object since the tool takes no parameters.inputSchema: { type: 'object', properties: {}, required: [], },