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. Since 2026-11-21 hashn keeps a file as it is now, not every save: receipt reads only the current save (an older one: 410 history_ended).

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

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.3/5.0
Behavior4/5

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

Annotations only cover readOnlyHint and openWorldHint, so the description carries the rest and does well: size ceiling, text-vs-base64 return behavior, access scope, and a named failure mode (410 history_ended). Minor deduction because the phrase "with encoding='base64'" implies a parameter that does not exist in the schema, which could confuse an agent about how to request base64.

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?

Three compact sentences, front-loaded with the capability and size limit, then access scope, then the receipt caveat. The final sentence ("hashn keeps a file as it is now, not every save") is convoluted relative to the rest and takes a second pass to parse.

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 four-parameter read tool with no output schema, the description covers the essentials an agent needs: what comes back, how big it can be, what it can reach, and one error condition. It would be fully complete with a note on what happens when the path does not exist or when a private workspace is inaccessible.

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; the description earns above that by clarifying receipt semantics beyond the schema text, notably that a receipt pins an exact save and that stale receipts fail with 410. The stray encoding reference is the only ambiguity added.

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 ('Read a file') plus a concrete scope limit ('up to 1 MiB'), and explicitly routes larger reads to get_file_link. An agent can distinguish this from the sibling link/history tools without opening any 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 clear context: works on your workspaces and any public one, and names get_file_link as the alternative for files over 1 MiB. It also explains the receipt case (current save only, older saves return 410 history_ended), though it stops short of saying when to prefer file_history to discover a receipt in the first place.

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