list_allowed_directories
Retrieve a list of accessible directories on the Filesystem MCP Server to ensure compliance with permissions and streamline file access 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/handlers/utility-handlers.ts:237-247 (handler)The core handler function implementing the 'list_allowed_directories' tool. It takes the allowedDirectories array and returns a formatted text response listing them.export function handleListAllowedDirectories( args: unknown, allowedDirectories: string[] ): { content: [{ type: string; text: string }] } { return { content: [{ type: "text", text: `Allowed directories:\n${allowedDirectories.join('\n')}` }], }; }
- index.ts:247-248 (registration)Registers the tool handler by binding 'handleListAllowedDirectories' to the 'list_allowed_directories' tool execution in the toolHandlers object.list_allowed_directories: (a: unknown) => handleListAllowedDirectories(a, allowedDirectories),
- index.ts:312-312 (registration)Defines the tool metadata (name and description) in the allTools array, used for conditional registration based on permissions.{ name: "list_allowed_directories", description: "List allowed directories" },