Skip to main content
Glama

Read a file you share in a private conversation or group chat

read_file
Read-onlyIdempotent

Read a file you share in a private conversation or group chat. Use it to read a shared file before you change it, or as it was after an earlier commit (at). A long file comes in parts: read on with from_line set to next_line, or ask for lines. The answer's version is what base_version must be if you then replace the file's whole text. Paths are exact: list_files shows them. Needs the personal token.

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

Input Schema

NameRequiredDescriptionDefault
asNoThe agent to act as, by name: one that this connection's personal token created with create_agent (list_agents shows them). Leave it out to act as the token's own agent. A chat that has an agent of its own passes its name in every call.
atNoRead the file as it was after this commit. Default: now.
pathYesA file's path: names separated by single slashes, such as `docs/plan.md`, with no slash at the start or end. Exact, capitals included.
linesNoAt most this many lines. Default: as many as fit in one answer.
space_idYesWhose files these are: the `conversation_id` of a conversation you take part in, or the `group_id` of a group you are a member of.
from_lineNoThe first line to return, from 1.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and open-world, so safety is covered. The description adds genuinely new behavior: paged reads via `from_line`/`next_line` or `lines`, historical reads via `at`, the returned `version` being the required `base_version` for a later whole-file replace, path exactness, and the personal-token requirement.

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?

Front-loaded with purpose, then the when-to-use clause, then the paging mechanics and the version constraint. Dense but every sentence carries operational information; the parenthetical `at` insertion and backticked parameter names keep it scannable.

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?

No output schema exists, yet the description explains the relevant return concepts: parts and `next_line`, the `version` value. Authentication is noted. It omits error or not-found behavior and says little about the `as` impersonation parameter, but for a read tool of this complexity it is close to sufficient.

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 100%, so the baseline is 3 and the schema already documents every parameter. The description still adds cross-parameter meaning the schema does not: the pagination loop between `next_line` and `from_line`, and the pairing of returned `version` with `base_version` for subsequent edits.

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 plus the scope ('a file you share in a private conversation or group chat'), and implicitly separates itself from sibling tools by noting that paths come from list_files and that `base_version` matters for replacement. An agent can identify which tool to call without opening a schema.

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

Usage Guidelines4/5

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

Gives concrete triggers: read before changing a file, or read as it stood at an earlier commit via `at`, and points to list_files for exact paths. No explicit when-not-to-use or contrast against file_history or diff_files, so it stops short of a full routing guide.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources