Skip to main content
Glama

read_file

Read-only

Reads one file by absolute path - e.g., decompiled source or AndroidManifest.xml - returning its content. Files over 512 KB are truncated.

Instructions

Read one file's contents by absolute path - e.g. a decompiled source file or an AndroidManifest.xml from decode_apk's output. Only reads. Content over 512 KB is cut off at 512 KB, signalled by truncated: true. Returns { filePath, size, truncated, encoding, content } where size is the full file size in bytes. Errors if the path doesn't exist or is a directory (use list_files to see what's in a directory first).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
encodingNoHow content is returned. Default utf8; use base64 for binary files.utf8
filePathYesAbsolute path to the file to read.
workspaceNoWorkspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to "default".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.3.7
    • addedInput schema / properties / encoding / default
      Added value: +"utf8"
    • changedInput schema / properties / encoding / description
      Previous value: -"Default utf8; use base64 for binary files."New value: +"How content is returned. Default utf8; use base64 for binary files."
    • changedInput schema / properties / filePath / description
      Previous value: -"Absolute path to the file to read"New value: +"Absolute path to the file to read."
    • changedInput schema / properties / workspace / description
      Previous value: -"Workspace name (not id) - created automatically if it doesn't exist yet. Defaults to \"default\"."New value: +"Workspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to \"default\"."
  2. Changed1 schema field changedv1.3.1
    • addedInput schema / properties / filePath / description
      Added value: +"Absolute path to the file to read"
  3. First observedv1.3.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, but the description goes well beyond them: the 512 KB truncation limit with a truncated:true signal, the exact return shape, and error conditions (missing path, or directory instead of file). This is materially useful behavior disclosure.

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-loads the core purpose, then layers scope, limits, return shape, and error guidance in a tight, ordered sequence. Every sentence carries distinct information with no redundancy.

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?

With no output schema, the description fully carries return semantics (filePath, size, truncated, encoding, content) and error behavior, plus the truncation caveat. Nothing an agent needs to call this correctly is missing.

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 description coverage is 100%, so encoding, filePath, and workspace are already documented in the schema. The description's mention of 'absolute path' reinforces filePath but adds little beyond what the schema provides, so baseline 3 applies.

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?

Clear verb (Read) plus resource (file's contents) and scope (one file, by absolute path). The examples - a decompiled source file or AndroidManifest.xml from decode_apk's output - anchor it concretely and distinguish it from sibling listing/search tools.

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?

Explicitly states 'Only reads' and directs the agent to list_files before reading a directory, naming the alternative for that case. It gives strong context but does not enumerate when to prefer search_code or other readers over this one.

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