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
| Name | Required | Description | Default |
|---|---|---|---|
| linesOfOutput | Yes | Number of lines of output to read |
Implementation Reference
- src/index.ts:125-136 (handler)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'], }, },
- src/index.ts:59-68 (schema)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'], },
- src/index.ts:15-15 (helper)Class property 'outputBuffer' used by the 'read_terminal_output' tool to store terminal output lines.private outputBuffer: string[] = [];