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[] = [];

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