Skip to main content
Glama

workspace_read_file

Read-only

Read UTF-8 text from workspace files, optionally selecting an inclusive one-based line range for targeted content retrieval.

Instructions

Read UTF-8 text, optionally selecting an inclusive range of one-based lines.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "workspace_read_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
end_lineNo
start_lineNo

Output Schema

NameRequiredDescriptionDefault
pathYes
textYes
resourcesNo
start_lineYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.1
    • addedInput schema / additionalProperties
      Added value: +false
  2. Addedv0.2.2

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered without prose. The description adds genuinely new behavior: fixed UTF-8 decoding and inclusive one-based line selection. It omits what happens for non-UTF-8/binary files, encoding errors, or very large files, which are the practical failure modes for a read tool.

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?

A single front-loaded sentence with no filler; the core action comes first and the optional range qualifier follows. Every clause conveys distinct information.

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

Completeness3/5

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

An output schema exists, so return-value shape need not be described. For a 3-parameter read tool the remaining gaps are path resolution rules and error/edge-case behavior (binary or non-UTF-8 files, out-of-range line numbers), which are not covered anywhere in the structured fields.

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 0%, so the description carries the burden and does partially succeed: it clarifies that start_line/end_line form an inclusive, one-based range and are optional. However, it says nothing about how `path` is resolved (workspace-relative, absolute, escaping the root) and does not state how end_line behaves when omitted, leaving the most-used parameter undefined.

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?

States a specific verb (read) and resource (UTF-8 text/file) plus the optional line-range capability, so an agent can distinguish it from workspace_list, workspace_file_info, and workspace_text_search. It stops short of naming siblings or stating the path's base (workspace-relative vs absolute), so it is clear but not fully differentiated.

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 when-to-use or when-not-to-use guidance is given, and no alternative tool is named for the adjacent jobs (workspace_file_info for metadata, workspace_text_search for locating content, workspace_write_file for mutation). The line-range clause hints at large-file use but never states it as a rule.

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