Skip to main content
Glama

read_terminal_output

Retrieve terminal output from Windows command line to monitor command results, capture error messages, and verify execution status for automated workflows.

Instructions

Read the output from the terminal

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linesOfOutputYesNumber of lines of output to read

Implementation Reference

  • Handler function for the 'read_terminal_output' tool. It retrieves the last 'linesOfOutput' lines from the output buffer and returns them as text content.
    case 'read_terminal_output': {
      const { linesOfOutput } = request.params.arguments as { linesOfOutput: number };
      const output = this.outputBuffer.slice(-linesOfOutput).join('\n');
      return {
        content: [
          {
            type: 'text',
            text: output,
          },
        ],
      };
    }
  • src/index.ts:56-69 (registration)
    Registration of the 'read_terminal_output' tool in the ListTools response, including name, description, and input schema.
    {
      name: 'read_terminal_output',
      description: 'Read the output from the terminal',
      inputSchema: {
        type: 'object',
        properties: {
          linesOfOutput: {
            type: 'number',
            description: 'Number of lines of output to read',
          },
        },
        required: ['linesOfOutput'],
      },
    },
  • Input schema definition for the 'read_terminal_output' tool, specifying the 'linesOfOutput' parameter.
    inputSchema: {
      type: 'object',
      properties: {
        linesOfOutput: {
          type: 'number',
          description: 'Number of lines of output to read',
        },
      },
      required: ['linesOfOutput'],
    },
  • Class property 'outputBuffer' used by the 'read_terminal_output' tool to store terminal output lines.
    private outputBuffer: string[] = [];
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 only states the action ('Read') without details on permissions, side effects, or response format. This is inadequate for a tool that interacts with terminal output, as it omits critical context like whether it reads recent or historical output, or if it requires specific terminal states.

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, efficient sentence with zero waste. It is front-loaded and directly states the tool's function without unnecessary elaboration, making it easy to parse quickly.

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 lack of annotations and output schema, the description is incomplete. It fails to address behavioral aspects like what 'output' entails, potential errors, or return values. For a tool with a parameter and no structured safety hints, more context is needed to guide effective use.

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?

The input schema has 100% description coverage, clearly documenting the 'linesOfOutput' parameter. The description adds no additional meaning beyond the schema, such as explaining typical values or constraints. Baseline 3 is appropriate since the schema does the heavy lifting, but no extra value is added.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action ('Read') and target ('output from the terminal'), which clarifies the tool's basic function. However, it lacks specificity about what 'output' means (e.g., recent output, buffered content) and does not differentiate from sibling tools like 'write_to_terminal' or 'send_control_character', leaving room for ambiguity.

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. The description does not mention prerequisites (e.g., terminal must be active), exclusions, or comparisons to siblings like 'write_to_terminal' for input operations, leaving the agent without context for selection.

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/capecoma/winterm-mcp'

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