list_allowed_directories
Discover which directories the LSP Tools MCP Server can access. Use this tool to verify accessible paths before attempting file operations, preventing access errors.
Instructions
Lists all directories that this server is allowed to access. Use this to understand which paths are accessible before trying to access files. Returns an array of absolute paths to allowed directories.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:120-127 (handler)Handler for the 'list_allowed_directories' tool. Returns a JSON string of the allowedDirectories array wrapped in the MCP content format.case "list_allowed_directories": { return { content: [{ type: 'text', text: JSON.stringify(allowedDirectories), }] }; }
- src/index.ts:48-49 (schema)Zod schema for the tool's input arguments, which is empty as no parameters are required.// Schema for list_allowed_directories tool (empty object, no parameters needed) const ListAllowedDirectoriesArgsSchema = z.object({});
- src/index.ts:79-86 (registration)Registration of the tool in the ListTools response, defining name, description, and input schema.{ name: "list_allowed_directories", description: "Lists all directories that this server is allowed to access. " + "Use this to understand which paths are accessible before trying to access files. " + "Returns an array of absolute paths to allowed directories.", inputSchema: zodToJsonSchema(ListAllowedDirectoriesArgsSchema), },
- src/index.ts:23-26 (helper)Helper variable that stores and normalizes the allowed directories from command-line arguments, used by the handler.// Store allowed directories in normalized form const allowedDirectories = args.map(dir => normalizePath(path.resolve(expandHome(dir))) );