list_allowed_directories
Display directories accessible within the MCP Smart Filesystem Server's security boundaries to identify permitted file system areas for safe exploration.
Instructions
Show which directories this server can access (security boundaries). No parameters required.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.ts:501-512 (handler)The handler function for the 'list_allowed_directories' tool. It serializes and returns the list of allowed directories (via getAllowedDirectories helper), including count and security note.case 'list_allowed_directories': { return { content: [{ type: 'text', text: JSON.stringify({ allowedDirectories: getAllowedDirectories(), count: getAllowedDirectories().length, note: 'This server can only access files within these directories for security' }, null, 2) }] }; }
- index.ts:249-256 (registration)Tool registration in the tools array returned by ListToolsRequestSchema handler. Defines name, description, and empty input schema (no parameters).{ name: 'list_allowed_directories', description: 'Show which directories this server can access (security boundaries). No parameters required.', inputSchema: { type: 'object', properties: {} } }
- index.ts:252-255 (schema)Input schema definition for the tool (empty object, no required parameters).inputSchema: { type: 'object', properties: {} }
- lib.ts:6-17 (helper)Global state management and helper functions for allowed directories. getAllowedDirectories() is called by the tool handler to retrieve the list.// Global allowed directories - set by the main module let allowedDirectories: string[] = []; // Function to set allowed directories from the main module export function setAllowedDirectories(directories: string[]): void { allowedDirectories = [...directories]; } // Function to get current allowed directories export function getAllowedDirectories(): string[] { return [...allowedDirectories]; }