List Allowed Directories
list_allowed_directoriesDiscover accessible directories and their subdirectories in the Filesystem MCP Server to verify available paths before file operations.
Instructions
Returns the list of directories that this server is allowed to access. Subdirectories within these allowed directories are also accessible. Use this to understand which directories and their nested paths are available before trying to access files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes |
Implementation Reference
- src/filesystem/index.ts:677-683 (handler)The inline async handler function for the 'list_allowed_directories' tool. It formats and returns the list of allowed directories as text content.
async () => { const text = `Allowed directories:\n${allowedDirectories.join('\n')}`; return { content: [{ type: "text" as const, text }], structuredContent: { content: text } }; } - src/filesystem/index.ts:666-675 (schema)Input and output schema definition for the 'list_allowed_directories' tool. No input parameters required, outputs string content.
{ title: "List Allowed Directories", description: "Returns the list of directories that this server is allowed to access. " + "Subdirectories within these allowed directories are also accessible. " + "Use this to understand which directories and their nested paths are available " + "before trying to access files.", inputSchema: {}, outputSchema: { content: z.string() }, annotations: { readOnlyHint: true } - src/filesystem/index.ts:664-684 (registration)The server.registerTool call that registers the 'list_allowed_directories' tool, including its schema and inline handler implementation.
server.registerTool( "list_allowed_directories", { title: "List Allowed Directories", description: "Returns the list of directories that this server is allowed to access. " + "Subdirectories within these allowed directories are also accessible. " + "Use this to understand which directories and their nested paths are available " + "before trying to access files.", inputSchema: {}, outputSchema: { content: z.string() }, annotations: { readOnlyHint: true } }, async () => { const text = `Allowed directories:\n${allowedDirectories.join('\n')}`; return { content: [{ type: "text" as const, text }], structuredContent: { content: text } }; } );