Skip to main content
Glama

Read one code file

read_file
Read-only

Retrieves one code file's content by workspace ID and case-sensitive name, enabling you to inspect a file before rewriting or replacing it.

Instructions

Returns ONE code file's content. Names are case-sensitive. Cheaper and safer than get_workspace_content when you only need a file — and you must read a file before rewriting it, since write_file replaces the whole thing.

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": {
      "workspaceId": "<workspaceId>",
      "name": "<name>"
    },
    "name": "read_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesCase-sensitive file name, folders with "/" — e.g. "pages/app.css", "lib/http.js".
workspaceIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.53.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, and the description stays consistent while adding useful context: case-sensitive lookups, cost/safety relative to get_workspace_content, and the destructive-replacement semantics of write_file. It does not describe error behavior for a missing file, which keeps it from a 5.

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?

Two sentences with zero filler; the identity of the tool comes first, then the routing/precondition guidance. Every clause carries information an agent needs.

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

Completeness4/5

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

For a simple two-parameter read tool with annotations covering safety, this is nearly complete — it covers what it returns, how to route to it, and the read-before-write discipline. Minor gaps: no mention of what happens for a nonexistent file/path or size limits on returned content.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50%: name is documented (including folder syntax) in the schema, but workspaceId is not. The description compensates partially by stressing that names are case-sensitive, which is the main failure mode for the documented parameter, though workspaceId semantics remain unaddressed in both places.

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 ("Returns ONE code file's content") with the scope emphasized by "ONE", and explicitly distinguishes it from get_workspace_content and write_file.

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 the alternative and the condition that selects this tool ("Cheaper and safer than get_workspace_content when you only need a file"), and adds a hard precondition for the write path ("you must read a file before rewriting it").

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