Skip to main content
Glama

approve_command_type

Authorize specific command types (read, write, system) for secure terminal access during AI assistant sessions, enabling controlled system interaction with session-based permissions.

Instructions

Approve a command type for the current session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
command_typeYesThe command type to approve (read, write, system)
session_idYesThe session ID
rememberNoWhether to remember this approval

Implementation Reference

  • The MCP tool handler function for 'approve_command_type', which handles user input, validates the command type, and calls the session manager.
    async def approve_command_type(
        command_type: str, session_id: str, remember: bool = False
    ) -> Dict[str, Any]:
        """
        Approve a command type for the current session.
    
        Args:
            command_type: The command type to approve (read, write, system)
            session_id: The session ID
            remember: Whether to remember this approval for the session
    
        Returns:
            A dictionary with approval status
        """
        if command_type not in ["read", "write", "system"]:
            return {
                "success": False,
                "message": f"Invalid command type: {command_type}",
            }
    
        if remember:
            self.session_manager.approve_command_type(session_id, command_type)
            return {
                "success": True,
                "message": f"Command type '{command_type}' approved for this session",
            }
        else:
            return {
                "success": True,
  • The session manager's method that performs the actual persistence of the approved command type for a given session.
    def approve_command_type(self, session_id: str, command_type: str) -> None:
        """Approve a command type for a session.
    
        Args:
            session_id: The session ID
            command_type: The command type to approve
        """
        session = self.get_session(session_id)
        session["approved_command_types"].add(command_type)
    
    def has_directory_approval(self, session_id: str, directory: str) -> bool:
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 mentions scope ('current session') but fails to explain whether approval is reversible, what permissions it grants, side effects, or persistence behavior beyond the 'remember' parameter hint.

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 single sentence is front-loaded and contains no wasted words. However, given the lack of annotations and security-sensitive nature of the tool, the extreme brevity leaves critical gaps that could be considered under-sizing rather than admirable conciseness.

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

Completeness2/5

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

Despite 100% schema coverage, the description is insufficient for a permission-control tool with no output schema or annotations. It omits the approval workflow, relationship to execution tools, and security implications that an agent would need to select this tool correctly.

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

Parameters3/5

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

Schema description coverage is 100%, documenting all three parameters including the enum-like values for 'command_type' (read, write, system). The description adds no additional parameter context, meeting the baseline expectation when the schema is self-documenting.

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 states a specific verb ('Approve') and resource ('command type') and scopes it to the 'current session'. It distinguishes from sibling 'approve_directory' by referencing 'command_type' rather than directories. However, it omits what 'approval' means functionally or why it's needed.

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?

No guidance is provided on when to use this tool versus alternatives, or when approval is required. Given siblings like 'execute_command' and 'execute_read_command', the description should clarify that approval is a prerequisite for execution, but it does not.

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/wwqdrh/MCPcmd'

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