Skip to main content
Glama
axross-headless-mcp

axross-headless-mcp

Read file

read_file
Read-onlyIdempotent

Read a file's contents as raw base64 bytes or UTF-8 text, up to 4 MiB per call, and page through larger files using a byte offset.

Instructions

Read one file's contents as base64 bytes or UTF-8 text, at most 4 MiB per call. Use when: you need a file's contents; page through a larger one with offset. Instead: search_content to find lines across files; read_file_version for an older version; render_preview for an image. Behavior: read-only. Refuses secret files. A folder or missing file fails; text never cuts a character in two. Time limit: 15 s. Returns: {content_b64 or text, size (bytes in this page; get_path_info gives the file's), truncated, replaced (text: bad bytes became U+FFFD)}. When truncated, or when offset was given, also offset and next_offset. An offset past the end returns empty content with truncated false.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "read_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoThe file to read (absolute, or relative to the MCP root). Required unless path_b64 is given.
offsetNoByte offset to start at; pass the previous call's next_offset to continue.
backendNoBackend id from list_backends; omit for the default.
encodingNobase64 (default): the exact bytes, safe for any file. text: decoded as UTF-8 - pass it for text files.base64
path_b64Nopath as base64 of its raw bytes, for non-UTF-8 names; replaces path.
max_bytesNoMost bytes to return; 0 or omitted means the ceiling, 4194304 (4 MiB).

Output Schema

NameRequiredDescriptionDefault
sizeYesbytes read
textNothe text (encoding=text)
offsetNo
replacedNotext: undecodable bytes replaced
truncatedYes
content_b64Nothe bytes (encoding=base64)
next_offsetNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv0.15.181
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / backend / description
      Previous value: -"Optional backend id. Omit to use the default; call 'list_backends' to enumerate."New value: +"Backend id from list_backends; omit for the default."
    • changedInput schema / properties / encoding / description
      Previous value: -"base64 (exact bytes) or text (UTF-8, for text files)."New value: +"base64 (default): the exact bytes, safe for any file. text: decoded as UTF-8 - pass it for text files."
    • addedInput schema / properties / max_bytes / default
      Added value: +4194304
    • addedInput schema / properties / max_bytes / description
      Added value: +"Most bytes to return; 0 or omitted means the ceiling, 4194304 (4 MiB)."
    • addedInput schema / properties / max_bytes / maximum
      Added value: +4194304
    • addedInput schema / properties / offset / description
      Added value: +"Byte offset to start at; pass the previous call's next_offset to continue."
    • addedInput schema / properties / path / description
      Added value: +"The file to read (absolute, or relative to the MCP root). Required unless path_b64 is given."
    • addedInput schema / properties / path / minLength
      Added value: +1
    • addedInput schema / properties / path_b64 / contentEncoding
      Added value: +"base64"
    • changedInput schema / properties / path_b64 / description
      Previous value: -"Instead of path: base64 of the name's raw bytes, for a name that is not UTF-8 (listings give such a name as U+FFFD plus a path_b64 / name_b64 field)."New value: +"path as base64 of its raw bytes, for non-UTF-8 names; replaces path."
    • removedInput schema / required
      Removed value: -[
      -  "path"
      -]
  2. Changed1 schema field changedv0.15.180
    • addedInput schema / properties / backend
      Added value: +{
      +  "description": "Optional backend id. Omit to use the default; call 'list_backends' to enumerate.",
      +  "type": "string"
      +}
  3. First observedv0.15.179

TDQS

A4.7/5.0
Behavior4/5

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

Beyond the annotations (readOnly, idempotent, non-destructive), the description discloses access constraints (refuses secret files), failure modes (folder or missing file fails), a hard time limit (15 s), and byte-safe text decoding that never splits a character. That is meaningful disclosure annotations cannot carry. It stops just short of 5 because some of the remaining behavioral detail overlaps the output schema, though the 15 s timeout and the offset-past-end edge case are genuinely extra.

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?

Front-loaded with the verb and resource, then cleanly partitioned into Use when / Instead / Behavior / Returns labels. Every sentence carries a decision-relevant fact (limits, failures, truncation, offset chaining) with no filler; density is high but the structure keeps it scannable.

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?

For a six-parameter tool with an output schema and full annotations, the description covers the exact gaps structured fields cannot: sibling routing, failure modes, time limit, secret-file refusal, and pagination protocol. An agent has everything needed to invoke it correctly and interpret a truncated or empty result.

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 a 3 is the baseline; the description still adds cross-call meaning by tying offset to the previous call's next_offset and explaining that an offset past the end yields empty content with truncated false. The 4 MiB ceiling and page semantics are reinforced and clarified in prose rather than merely restated.

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?

"Read one file's contents as base64 bytes or UTF-8 text, at most 4 MiB per call" names a specific verb, resource, output forms, and a hard size bound in a single sentence. It also explicitly contrasts itself with search_content, read_file_version, and render_preview, so an agent can distinguish it from adjacent file tools without reading 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 Guidelines5/5

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

The "Use when" / "Instead" structure gives both positive triggers (need a file's contents; page through a larger one with offset) and named alternatives with the condition that selects each (search_content for line search across files, read_file_version for an older version, render_preview for images). This is explicit when/when-not/alternative guidance.

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