Skip to main content
Glama

read_file

Read-only

Read a file (up to 1 MiB). Text comes back as text; other bytes as base64 with encoding='base64'. Works on your workspaces and any public one. For larger files use get_file_link. With receipt (0.62.0), the exact bytes of that save (the number file_history's receipts give), so a citation <path>@<receipt> can be re-fetched and checked against its sha256; older saves are for the workspace's members, and a deleted file's saves aren't served.

Input Schema

NameRequiredDescriptionDefault
pathYesThe file to read, like 'drafts/report.md'.
receiptNoOptional: a save's number (file_history's receipts; the files listing gives the latest) to read exactly the bytes of that save instead of the current ones.
api_tokenNoYour hashn API token, if you can't send it as the 'Authorization: Bearer <token>' header. Omit it when the header is set.
workspace_idYesThe workspace's id (a UUID), from create_workspace, list_workspaces or the store.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / receipt
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional: a save's number (file_history's receipts; the files listing gives the latest) to read exactly the bytes of that save instead of the current ones.",
      +  "title": "Receipt"
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / api_token / description
      Added value: +"Your hashn API token, if you can't send it as the 'Authorization: Bearer <token>' header. Omit it when the header is set."
    • addedInput schema / properties / path / description
      Added value: +"The file to read, like 'drafts/report.md'."
    • addedInput schema / properties / workspace_id / description
      Added value: +"The workspace's id (a UUID), from create_workspace, list_workspaces or the store."
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already mark it read-only and closed-world, but the description adds substantial behavioral context: the 1 MiB limit, text versus base64 return behavior, receipt-based exact-byte retrieval, sha256 checking, and deleted-file save limitations. These are meaningful operational details beyond the annotations.

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 description is front-loaded with the core action and size limit, then layers in return behavior and alternatives. The receipt explanation is dense and slightly run-on, but every clause carries useful information.

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?

There is no output schema, but the description explains the return format (text or base64) and size limit. It also covers public/workspace access and receipt-specific retrieval behavior, leaving little ambiguity for correct invocation.

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 description coverage is 100%, so the schema already documents all four parameters. The description still adds useful meaning for receipt by tying it to file_history receipts, exact saved bytes, and citation re-fetching, though it does not add much beyond the schema for workspace_id or api_token.

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?

The description states a specific verb and resource ("Read a file") and immediately adds scope ("up to 1 MiB") plus return-format behavior. It distinguishes itself from get_file_link for larger files, so an agent can identify the tool's role without opening the schema.

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?

It explicitly says to use get_file_link for larger files, which gives a clear when-not condition and names the alternative. It also clarifies that it works on the user's workspaces and any public one, and explains when the receipt parameter should be used.

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