Skip to main content
Glama
andresthor

Command-Line MCP Server

by andresthor

get_command_help

Retrieve detailed information about supported terminal commands, security restrictions, and usage guidelines for safe command execution.

Instructions

Get detailed help about command capabilities and usage.

This tool provides comprehensive information about:

  • Supported commands in each category (read, write, system)

  • Blocked commands for security reasons

  • Command chaining capabilities (pipes, semicolons, ampersands)

  • Usage restrictions and examples

Returns: A dictionary with detailed information about command capabilities and usage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the get_command_help handler function.
    async def get_command_help() -> dict[str, Any]:
        """
        Get detailed help about command capabilities and usage.
    
        This tool provides comprehensive information about:
        - Supported commands in each category (read, write, system)
        - Blocked commands for security reasons
        - Command chaining capabilities (pipes, semicolons, ampersands)
        - Usage restrictions and examples
    
        Returns:
            A dictionary with detailed information about command capabilities and usage
        """
        # Get the latest command lists and separator support
        command_lists = self.config.get_effective_command_lists()
        separator_support = self.config.has_separator_support()
    
        # Log the separator support for debugging
        logger.info(f"Separator support status: {separator_support}")
        logger.info(
            f"allow_command_separators setting: {self.config.get('security', 'allow_command_separators')}"
        )
    
        # Extra check for pipe character in dangerous patterns
        pipe_in_patterns = any(
            "|" in p or r"\|" in p for p in command_lists["dangerous_patterns"]
        )
        logger.info(
            f"Pipe character found in dangerous patterns: {pipe_in_patterns}"
        )
    
        # Update capabilities
        updated_capabilities = {
            "supported_commands": {
                "read": command_lists["read"],
                "write": command_lists["write"],
                "system": command_lists["system"],
            },
            "blocked_commands": command_lists["blocked"],
            "command_chaining": {
                "pipe": (
                    "Supported" if separator_support["pipe"] else "Not supported"
                ),
                "semicolon": (
                    "Supported"
                    if separator_support["semicolon"]
                    else "Not supported"
                ),
                "ampersand": (
                    "Supported"
                    if separator_support["ampersand"]
                    else "Not supported"
                ),
            },
            "command_restrictions": "Special characters like $(), ${}, backticks, and I/O redirection are blocked",
        }
    
        # Provide helpful information for Claude to understand command usage
        return {
            "capabilities": updated_capabilities,
            "examples": self.usage_examples,
            "recommended_approach": {
                "finding_large_files": "Use 'du -h <directory>/* | sort -hr | head -n 10' to find the 10 largest files",
                "file_searching": "Use 'find <directory> -type f -name \"pattern\"' for file searches",
                "text_searching": "Use 'grep \"pattern\" <file>' to search in files",
                "file_viewing": "Use 'cat', 'head', or 'tail' for viewing files",
                "sorting": "Use 'sort' with options like -n (numeric), -r (reverse), -h (human readable sizes)",
                "text_processing": "Use 'awk' for advanced text processing. For example: 'ls -la | awk \"{print $1, $9}\"' to show permissions and filenames",
                "column_filtering": "Use 'awk' to filter by column values: 'cat data.txt | awk \"{if($3 > 100) print}\"' to show lines where column 3 exceeds 100",
            },
            "permissions": {
                "read_commands": "Can be executed without confirmation",
                "write_commands": "Require approval for first use in a session",
                "system_commands": "Require approval for first use in a session",
            },
        }
Behavior3/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 'detailed information' in a dictionary format, which is helpful. However, it lacks behavioral details such as whether this is a read-only operation, if it requires authentication, or if there are rate limits, which are important for a tool in a command-execution context.

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 front-loaded with the core purpose. It uses bullet points to efficiently list what information is provided, and the 'Returns:' section clarifies the output format. It could be slightly more concise by integrating the bullet points into a single sentence, but overall it's 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 complexity (providing detailed help), the description is fairly complete. It outlines the types of information returned (commands, blocked commands, chaining, restrictions) and notes the output is a dictionary. Since an output schema exists, it doesn't need to detail return values further. However, it could benefit from mentioning any prerequisites or limitations to be fully comprehensive.

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 tool has 0 parameters, and the input schema has 100% description coverage (though empty). The description doesn't need to add parameter semantics, so it appropriately focuses on output. Since there are no parameters to document, this meets the baseline expectation for such cases.

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: 'Get detailed help about command capabilities and usage.' It specifies the verb ('get detailed help') and resource ('command capabilities and usage'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'list_available_commands' or 'get_configuration', which prevents a perfect 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' (which might list commands without detailed help) or 'get_configuration' (which might provide system settings), leaving the agent with no explicit context for tool selection.

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