list_allowed_directories
Retrieve the list of directories accessible by the MCP Filesystem Server to ensure compliance with path restrictions before performing file 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 access files.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:707-719 (handler)Handler for the list_allowed_directories tool. Returns the list of allowed directories from the server configuration as a formatted 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)Tool registration in the ListTools response. Defines 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:330-334 (schema)Input schema definition for list_allowed_directories tool, specifying an empty object (no input parameters needed).inputSchema: { type: 'object', properties: {}, required: [], },