Skip to main content
Glama
StrawHatAI

Claude Desktop Commander MCP

by StrawHatAI

read_output

Retrieve terminal output from active processes to monitor command execution results in real-time.

Instructions

Read new output from a running terminal session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYes

Implementation Reference

  • The core handler function for the 'read_output' tool. Parses input arguments using ReadOutputArgsSchema, retrieves new output from terminalManager.getNewOutput(pid), and returns formatted text content or error message if no session.
    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 input schema for 'read_output' tool requiring a single 'pid' property of type number.
    export const ReadOutputArgsSchema = z.object({
      pid: z.number(),
    });
  • src/server.ts:66-71 (registration)
    Tool specification registration in ListToolsRequestHandler, providing name, description, and JSON schema derived from ReadOutputArgsSchema.
    {
      name: "read_output",
      description:
        "Read new output from a running terminal session.",
      inputSchema: zodToJsonSchema(ReadOutputArgsSchema),
    },
  • src/server.ts:220-223 (registration)
    Dispatch case in CallToolRequestHandler that parses arguments with ReadOutputArgsSchema and invokes the readOutput handler function.
    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?

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.

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/StrawHatAI/claude-dev-tools'

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