Skip to main content
Glama
MrGNSS

Desktop Commander MCP

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);
    }
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 reads output but doesn't clarify if this is a read-only operation, what happens if the PID is invalid or the session has ended, whether it returns partial or complete output, or if there are rate limits. For a tool interacting with running processes, this leaves critical behavioral aspects unspecified.

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 that efficiently conveys the core functionality without unnecessary details. It's front-loaded and wastes no words, making it easy to parse quickly while still providing essential information.

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 address error conditions, output format, or how to handle multiple sessions, leaving significant gaps for an AI agent to infer behavior in a potentially error-prone context.

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 with 0% description coverage, so the description must compensate. It doesn't explain what 'pid' represents (e.g., process ID of a terminal session), its format, or how to obtain valid values. This gap makes it harder for an AI agent to use the tool correctly without additional context.

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 differentiate from sibling tools like 'read_file' or 'read_multiple_files' which also involve reading operations, leaving some ambiguity about when this specific tool is appropriate versus those alternatives.

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 minimal guidance, implying usage when there's a running terminal session with new output to read. It doesn't specify when to use this tool over alternatives like 'read_file' or 'list_processes', nor does it mention prerequisites such as needing an active session or how to identify valid PIDs. This lack of explicit context reduces its utility for an AI agent.

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/MrGNSS/ClaudeDesktopCommander'

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