Skip to main content
Glama

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
NameRequiredDescriptionDefault
surfaceYesTarget surface ref
workspaceNoTarget workspace ref
linesNoNumber of lines to read
scrollbackNoInclude 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),

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/EtanHey/cmuxlayer'

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