Skip to main content
Glama
MrGNSS

Desktop Commander MCP

by MrGNSS

read_output

Retrieve terminal output from active processes to monitor command execution results and track ongoing operations in your system.

Instructions

Read new output from a running terminal session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYes

Implementation Reference

  • The core handler function that implements the read_output tool logic. Parses input arguments using the schema, fetches new output for the given PID from the terminal manager, and returns formatted text content.
    export async function readOutput(args: unknown) {
      const parsed = ReadOutputArgsSchema.safeParse(args);
      if (!parsed.success) {
        throw new Error(`Invalid arguments for read_output: ${parsed.error}`);
      }
    
      const output = terminalManager.getNewOutput(parsed.data.pid);
      return {
        content: [{
          type: "text",
          text: output === null
            ? `No session found for PID ${parsed.data.pid}`
            : output || 'No new output available'
        }],
      };
    }
  • Zod schema defining the input parameters for read_output: requires a numeric PID identifying the terminal session.
    export const ReadOutputArgsSchema = z.object({
      pid: z.number(),
    });
  • src/server.ts:66-71 (registration)
    Tool registration in the MCP server's ListToolsRequestHandler, specifying name, description, and input schema for read_output.
    {
      name: "read_output",
      description:
        "Read new output from a running terminal session.",
      inputSchema: zodToJsonSchema(ReadOutputArgsSchema),
    },
  • src/server.ts:220-223 (registration)
    Dispatch handler in the MCP server's CallToolRequestHandler that parses arguments and delegates to the readOutput implementation.
    case "read_output": {
      const parsed = ReadOutputArgsSchema.parse(args);
      return readOutput(parsed);
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.8/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 of behavioral disclosure. It states the tool reads 'new output' but doesn't clarify what 'new' means (e.g., since last read, real-time), whether it's a one-time or continuous operation, or any limitations like rate limits or permissions required. The description is minimal and lacks critical behavioral details for a tool interacting with running processes.

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 zero wasted words. It's front-loaded with the core action and resource, making it easy to scan. Every word earns its place, achieving maximum efficiency without being overly terse.

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?

Given the complexity of interacting with running terminal sessions, no annotations, no output schema, and low parameter coverage, the description is incomplete. It doesn't explain what the tool returns (e.g., output text, error messages), how to handle multiple reads, or any side effects. For a tool with potential behavioral nuances, this minimal description is inadequate.

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

Parameters2/5

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

The input schema has 1 parameter (pid) with 0% description coverage, meaning the schema provides no semantic information. The description adds no parameter details—it doesn't explain what 'pid' represents (e.g., process ID of the terminal session) or how to obtain it. This fails to compensate for the low schema coverage, leaving the parameter undocumented.

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 action ('read') and resource ('new output from a running terminal session'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'read_file' or 'read_multiple_files', which also involve reading operations but from different sources. The description is specific but lacks sibling differentiation.

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 (e.g., that a terminal session must be running), exclusions (e.g., not for reading old output), or comparisons to siblings like 'read_file' for file-based reading. Usage is implied by the name and description but not explicitly stated.

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