Skip to main content
Glama
rajnaveen344

LSP Tools MCP Server

by rajnaveen344

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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),
        }]
      };
    }
  • 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),
    },
  • 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)))
    );
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that the tool returns 'an array of absolute paths to allowed directories,' which is useful behavioral context about the output format. However, it doesn't mention potential limitations like rate limits, permissions needed, or whether the list is cached.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with zero waste: the first states the purpose, and the second provides usage guidance and output details. It's front-loaded and efficiently structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no annotations, no output schema), the description is mostly complete. It explains what the tool does, when to use it, and the return format. However, without annotations or output schema, it could benefit from more behavioral details like error conditions or performance characteristics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so the baseline is 4. The description appropriately doesn't add parameter information since none exist, maintaining focus on the tool's purpose and output.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Lists all directories') and resource ('that this server is allowed to access'), distinguishing it from the sibling tool 'find_regex_position' which appears unrelated to directory listing. It provides a complete picture of what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool: 'Use this to understand which paths are accessible before trying to access files.' This provides clear context and purpose for invocation, though it doesn't mention alternatives since the sibling tool is unrelated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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