Skip to main content
Glama

terminal_list

Read-onlyIdempotent

View all active terminal sessions to monitor and manage multiple command-line interfaces across platforms.

Instructions

List all active terminal sessions.

Returns information about all terminal sessions that are currently
open and active.

Returns:
    dict: Contains a list of terminal sessions with their details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `terminal_list` function handles listing active terminal sessions by retrieving them from the `SessionManager`.
    async def terminal_list() -> dict:
        """List all active terminal sessions.
    
        Returns information about all terminal sessions that are currently
        open and active.
    
        Returns:
            dict: Contains a list of terminal sessions with their details.
        """
        manager = SessionManager.get_instance()
        sessions = await manager.list_sessions()
    
        return {
            "count": len(sessions),
            "terminals": [
                {
                    "session_id": s.id,
                    "name": s.name,
                    "platform": s.platform,
                }
                for s in sessions
            ],
        }
  • The tool `terminal_list` is registered using the `@mcp.tool` decorator.
    @mcp.tool(
        name="terminal_list",
        annotations={
            "title": "List Terminals",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": False,
        },
    )
Behavior4/5

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

The description adds useful behavioral context beyond annotations. Annotations already indicate readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false, covering safety and idempotency. The description adds that it returns 'all terminal sessions that are currently open and active', specifying scope and state, and describes the return format as a dict with session details, which is valuable since there's no output schema.

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 concise and well-structured: it starts with the core purpose, elaborates on scope and return details, and uses clear sentences. However, the 'Returns:' section is slightly redundant with the prior sentence, slightly reducing efficiency.

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 (0 parameters, no output schema) and rich annotations, the description is mostly complete. It explains what the tool does and what it returns. A minor gap is lack of error handling or edge case info, but overall it provides sufficient context for an agent to use it effectively.

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?

With 0 parameters and 100% schema description coverage, the baseline is 4. The description appropriately doesn't discuss parameters, as none exist, and focuses on the tool's function and output instead.

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 active terminal sessions' specifies the verb (list) and resource (terminal sessions). It distinguishes from siblings like terminal_close (close) and terminal_create_or_get (create/get), but doesn't explicitly contrast with terminal_get_output (get output) or terminal_send_input (send input), which are different operations.

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 prerequisites, context for usage, or exclusions. For example, it doesn't clarify if this should be used before terminal_get_output to identify sessions, or if it's only for monitoring purposes.

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/Hor1zonZzz/terminal-mcp'

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