Skip to main content
Glama

read_workspace

Read-only

Read a line range from a UTF-8 workspace file and return content, SHA-256, start line, and total lines. Use it to inspect files safely before passing the hash to write operations.

Instructions

Read a window of one UTF-8 text file and return its content, the file's sha256, start_line and total_lines. Read-only. Files over 2 MB and non-UTF-8 files are refused; credentials are redacted (redacted=true) and managed metadata is excluded. Keep the sha256 to pass as expected_sha256 to write_task_file. To find files use list_workspace; to get only a hash use get_source_reference.

Input Schema

NameRequiredDescriptionDefault
pathYesFile path relative to the root, for example 'src/app.py'.
root_idNoWhich root to read: 'project' (the registered repository), 'worktree' (a task's recorded worktree, needs execution_id) or the id of a read root the operator granted.project
max_linesNoMaximum lines to return, from 1 to 600.
project_idYesRegistered project id, as returned by list_projects.
start_lineNoFirst line to return, counting from 1.
execution_idNoExecution id whose recorded worktree to read. Required when root_id is 'worktree'; ignored for other roots.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.1.3
    • addedInput schema / properties / execution_id / description
      Added value: +"Execution id whose recorded worktree to read. Required when root_id is 'worktree'; ignored for other roots."
    • addedInput schema / properties / max_lines / description
      Added value: +"Maximum lines to return, from 1 to 600."
    • addedInput schema / properties / path / description
      Added value: +"File path relative to the root, for example 'src/app.py'."
    • addedInput schema / properties / project_id / description
      Added value: +"Registered project id, as returned by list_projects."
    • addedInput schema / properties / root_id / description
      Added value: +"Which root to read: 'project' (the registered repository), 'worktree' (a task's recorded worktree, needs execution_id) or the id of a read root the operator granted."
    • addedInput schema / properties / start_line / description
      Added value: +"First line to return, counting from 1."
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnly/destructive annotations, it discloses the concrete constraints that shape behavior: files over 2 MB and non-UTF-8 files are refused, credentials are redacted with a redacted=true signal, and managed metadata is excluded. Those are exactly the surprises an agent would otherwise hit at call time.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The refusals and redaction constraints are front-loaded and each sentence carries real information. The only redundancy is the standalone 'Read-only' sentence, which restates readOnlyHint=true from the annotations and could be dropped.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a windowed file-read with six parameters, the description covers access constraints, redaction, return shape, and the follow-on handoff to write_task_file; the existing output schema handles the exact return structure. Nothing needed to call it correctly is missing.

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 coverage is 100%, so every parameter including root_id's root choices and execution_id's worktree dependency is already documented in the schema. The description adds only the start_line/total_lines windowing notion, which the schema's own defaults largely convey; baseline 3 applies when the schema carries the load.

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

Purpose5/5

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

States a specific verb and resource ('Read a window of one UTF-8 text file') plus exactly what is returned (content, sha256, start_line, total_lines). It also explicitly separates itself from list_workspace (finding files) and get_source_reference (hash only), so an agent can pick it out of a crowded sibling list.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Names two alternatives with the condition that selects each: list_workspace for discovery and get_source_reference for hashes only. It also gives a forward-looking usage rule — keep the sha256 to pass as expected_sha256 to write_task_file — which links this read to the subsequent write.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.