Skip to main content
Glama
andresthor

Command-Line MCP Server

by andresthor

list_directories

Retrieve approved directories for safe command execution, including global whitelists and session-specific permissions.

Instructions

List all whitelisted and approved directories.

Args: session_id: Optional session ID to get session-specific approvals

Returns: A dictionary with globally whitelisted and session-approved directories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function 'list_directories' which retrieves whitelisted and session-approved directories.
    async def list_directories(session_id: str | None = None) -> dict[str, Any]:
        """
        List all whitelisted and approved directories.
    
        Args:
            session_id: Optional session ID to get session-specific approvals
    
        Returns:
            A dictionary with globally whitelisted and session-approved directories
        """
        result = {
            "whitelisted_directories": self.whitelisted_directories,
            "session_approved_directories": [],
        }
    
        if session_id:
            result["session_approved_directories"] = list(
                self.session_manager.get_approved_directories(session_id)
            )
    
        return result
  • Tool registration for 'list_directories' within the MCP server application.
    list_directories_tool = self.app.tool()
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool lists directories and returns a dictionary, but doesn't cover critical aspects like whether it's read-only (implied by 'List' but not explicit), permissions required, rate limits, or error handling. 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.

Conciseness4/5

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

The description is well-structured and appropriately sized, with a clear purpose statement followed by Args and Returns sections. Every sentence adds value: the first states the action, and the subsequent lines explain parameters and return values. It's front-loaded and efficient, with minimal waste.

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 low complexity (1 optional parameter) and the presence of an output schema (which handles return value documentation), the description is reasonably complete. It covers the purpose, parameter semantics, and return structure. However, it lacks behavioral details like safety or usage context, which holds it back from a perfect score.

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 description adds meaningful context for the single parameter 'session_id', explaining it's 'Optional session ID to get session-specific approvals.' This clarifies the parameter's purpose beyond the schema's basic title 'Session Id'. With schema description coverage at 0% and only one parameter, the description effectively compensates, providing good semantic value.

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 tool's purpose: 'List all whitelisted and approved directories.' It specifies the verb ('List') and resource ('whitelisted and approved directories'), making the action clear. However, it doesn't explicitly differentiate this tool from sibling tools like 'list_available_commands' or 'get_configuration', which might also list things, so it doesn't reach the highest score.

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_available_commands' or explain the context for listing directories (e.g., for execution permissions). There's no explicit when-to-use or when-not-to-use information, leaving usage unclear.

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/andresthor/cmd-line-mcp'

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