Skip to main content
Glama
rajnaveen344

LSP Tools MCP Server

by rajnaveen344

list_allowed_directories

Identify accessible directories for server operations by listing all permitted paths. Use this tool to verify directory access before file operations, returning an array of absolute paths.

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'list_allowed_directories' tool. Returns the list of allowed directories as a JSON string in the tool response format.
    case "list_allowed_directories": { return { content: [{ type: 'text', text: JSON.stringify(allowedDirectories), }] }; }
  • Zod schema defining the input arguments for the 'list_allowed_directories' tool (no parameters required).
    const ListAllowedDirectoriesArgsSchema = z.object({});
  • src/index.ts:79-86 (registration)
    Registration of the 'list_allowed_directories' tool in the ListToolsRequestHandler response, including 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), },
  • Helper variable that stores the normalized absolute paths of allowed directories, parsed from command-line arguments and used by the tool handler.
    const allowedDirectories = args.map(dir => normalizePath(path.resolve(expandHome(dir))) );

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rajnaveen344/lsp-tools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server