Skip to main content
Glama

Read file

read_file
Read-onlyIdempotent

Reads a file by path. Content comes back as blocks in contentList — one per page for parsed documents, one per sheet for spreadsheets. Use blockIndex for a single block, startLine/lineCount to page through a large one.

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

Input Schema

NameRequiredDescriptionDefault
pathYesFull path of one file including its filename, e.g. '/docs/readme.md'.
contextYesExplain why you are calling this tool and how it fits into the user's overall goal. This parameter is used for analytics and user intent tracking. YOU MUST provide 15-25 words (count carefully). NEVER use first person ('I', 'we', 'you') - maintain third-person perspective. NEVER include sensitive information such as credentials, passwords, or personal data. Example (20 words): "Searching across the organization's repositories to find all open issues related to performance complaints and latency issues for team prioritization."
lineCountNoHow many lines to return starting at startLine. For parsed-document/text blocks, omit to read the block to its end. For spreadsheet sheets (xls/xlsx/csv), omit and you get at most 500 lines by default, not the whole sheet — check hasMore and raise startLine by lineCount to page through the rest.
startLineNo1-based first line to return within each block. Defaults to 1. Pair with lineCount to page through a block too large to read in one call.
blockIndexNoReturn only one content block, by 0-based index into the block list. A block is one page for parsed documents (pdf/doc/ppt) and one sheet for spreadsheets (xls/xlsx/csv). Omit to return every block. Note this is list position, not the block's own sequence number.
workspace_idNoWhich workspace to act in - a workspace id (whoami returns the id of your default workspace). Omit to use your default workspace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, so the safety profile is covered. The description adds genuinely new context: the return payload is organized into `contentList` blocks, one per document page or per spreadsheet sheet, which is essential behavior given there is no output schema. It stops short of describing error behavior for missing or unsupported files.

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?

Three short sentences, front-loaded with the verb and resource, then the return shape, then the paging knobs. Every clause carries information; nothing is redundant or padded.

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?

With six parameters, two required, and no output schema, the description covers the two things an agent most needs beyond the schema: what comes back (blocks in contentList) and how to narrow or page it. It omits any mention of the mandatory 15-25 word `context` analytics parameter and of workspace defaulting, though both are documented in the schema.

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 the schema already defines every parameter including the 500-line spreadsheet default and the blockIndex list-position caveat. The description reinforces blockIndex/startLine/lineCount using intent ('page through a large one') rather than syntax, so it adds modest framing but no details the schema lacks.

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 and resource with its addressing mode: 'Reads a file by path.' An agent knows exactly what it retrieves. However, it never distinguishes this from close siblings like file_summary or preview_file, so the agent must infer which of several read-ish tools to pick.

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

Usage Guidelines3/5

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

The second and third sentences give real in-tool routing guidance — blockIndex for a single block, startLine/lineCount to page a large one — which is helpful. But there is no guidance on when to choose this over file_summary or preview_file, and no mention of prerequisites such as the required `context` parameter or workspace scoping.

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