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),
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 mentions reading screen content but doesn't specify permissions needed, whether this is a read-only operation, potential rate limits, or what format the output returns. This leaves significant gaps for an agent to understand the tool's behavior.

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 that directly states the tool's function without unnecessary words. It's front-loaded with the core purpose and doesn't waste space on redundant information.

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?

For a tool with 4 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the output looks like (text format, structure), doesn't mention error conditions, and provides minimal behavioral context. Given the complexity of terminal screen reading, more completeness is needed.

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?

Schema description coverage is 100%, so all parameters are documented in the schema. The description doesn't add any additional semantic context about parameters beyond what's in the schema (e.g., explaining what a 'surface ref' represents or when to use scrollback). This meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the action ('Read') and resource ('current screen content of a terminal surface'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'read_agent_output' or 'browser_surface', which might have overlapping reading functionality in different contexts.

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 like 'read_agent_output' or 'browser_surface'. The description only states what it does, not when it's appropriate or what prerequisites might be needed for accessing terminal surfaces.

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

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