Skip to main content
Glama
MrGNSS

Desktop Commander MCP

by MrGNSS

list_allowed_directories

Check which directories the Desktop Commander MCP server can access to verify permissions for file operations and command execution.

Instructions

Returns the list of directories that this server is allowed to access.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that executes the tool logic, simply returning the predefined list of allowed directories.
    export function listAllowedDirectories(): string[] {
        return allowedDirectories;
    }
  • src/server.ts:188-197 (registration)
    Tool registration in the ListToolsRequestSchema handler, including name, description, and empty input schema (no parameters required).
    {
      name: "list_allowed_directories",
      description: 
        "Returns the list of directories that this server is allowed to access.",
      inputSchema: {
        type: "object",
        properties: {},
        required: [],
      },
    },
  • Dispatcher case in CallToolRequestSchema handler that invokes the listAllowedDirectories function and formats the response.
    case "list_allowed_directories": {
      const directories = listAllowedDirectories();
      return {
        content: [{ 
          type: "text", 
          text: `Allowed directories:\n${directories.join('\n')}` 
        }],
      };
    }
  • Helper constant defining the actual list of allowed directories used by the tool.
    const allowedDirectories: string[] = [
        process.cwd(), // Current working directory
        os.homedir()   // User's home directory
    ];
  • src/server.ts:38-39 (registration)
    Import of the handler function from filesystem module.
      listAllowedDirectories,
    } from './tools/filesystem.js';

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior2/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 states the tool returns a list, implying a read-only operation, but doesn't disclose behavioral traits such as permissions required, rate limits, error conditions, or format of the returned list. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, clear sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse. Every part of the sentence contributes directly to understanding the tool's function.

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

Completeness3/5

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

Given the tool has no parameters and no output schema, the description adequately covers the basic purpose. However, it lacks details on return format, error handling, or server-specific context, which could be important for an agent to use it effectively. With no annotations, it's minimally complete but has room for improvement.

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 no parameter documentation is needed. The description doesn't add param info, which is appropriate. Baseline is 4 for zero parameters, as it avoids redundancy and focuses on the tool's purpose.

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

Purpose4/5

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

The description clearly states the verb ('Returns') and resource ('list of directories'), specifying what the tool does. It distinguishes the scope ('that this server is allowed to access'), which adds clarity. However, it doesn't explicitly differentiate from sibling tools like 'list_directory', which might list directories without access restrictions, so it's not a perfect 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'list_directory' or 'search_files', nor does it specify prerequisites or contexts for usage. This leaves the agent without explicit direction on tool selection.

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