read_screen
Extract terminal screen content from a specified surface to monitor output, debug processes, or capture command results for AI agent orchestration.
Instructions
Read the current screen content of a terminal surface
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| surface | Yes | Target surface ref | |
| workspace | No | Target workspace ref | |
| lines | No | Number of lines to read | |
| scrollback | No | Include scrollback buffer |
Implementation Reference
- src/server.ts:344-376 (registration)Registration and implementation handler for the read_screen MCP tool in src/server.ts. It validates input using zod schema and calls client.readScreen.
server.tool( "read_screen", "Read the current screen content of a terminal surface", { surface: z.string().describe("Target surface ref"), workspace: z.string().optional().describe("Target workspace ref"), lines: z .number() .int() .min(1) .max(500) .optional() .default(20) .describe("Number of lines to read"), scrollback: z .boolean() .optional() .default(false) .describe("Include scrollback buffer"), }, async (args) => { try { const result = await client.readScreen(args.surface, { workspace: args.workspace, lines: args.lines, scrollback: args.scrollback, }); return ok({ surface: result.surface, lines: result.lines, content: result.text, scrollback_used: result.scrollback_used, parsed: parseScreen(result.text),