Skip to main content
Glama

Read a file from a deployed site

read_file
Read-onlyIdempotent

Return the bytes of one file currently served by the site. Use this to inspect or edit existing content (call read_file → modify → update_site mode:'patch') so a new chat can iterate on a site without re-uploading. Files larger than 5242880 bytes can't be read in one call. Use list of paths from get_site.filePaths to discover what's available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoSite name (subdomain) or custom domain. Same lookup rules as get_site.
pathYesSite-relative path of the file to read (e.g. 'index.html', 'assets/main.css'). No leading slash, no '..'.
siteIdNoAlternative to name. One of name|siteId is required.
maxBytesNoPer-file size cap. Default 1048576, hard max 5242880. If the file is larger, the call fails with FILE_TOO_LARGE rather than returning truncated bytes — splitting source mid-token would corrupt downstream edits.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
pathYesEchoes the input path, normalized (leading slash stripped, backslashes converted).
sizeYesSize in bytes of the file on the pod.
siteIdYes
contentYes
encodingYesHow to interpret `content`. utf8 means the file is text and `content` is the raw text. base64 means the file is binary (image/font/etc.) and `content` is base64 — decode before use.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedOutput schema / properties / request_id
      Removed value: -{
      -  "description": "Server-assigned request correlation id. Quote it when contacting support.",
      -  "type": "string"
      -}
  2. Changed1 schema field changed
    • addedOutput schema / properties / request_id
      Added value: +{
      +  "description": "Server-assigned request correlation id. Quote it when contacting support.",
      +  "type": "string"
      +}
  3. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, and non-destructive behavior. The description adds valuable context beyond those annotations: the 5242880-byte per-call limit and the fact that larger files fail with FILE_TOO_LARGE rather than returning truncated bytes, which protects against corrupt downstream edits. No contradiction with annotations.

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 sentences with no filler: the opening sentence states the core behavior, the second gives the workflow, and the third covers the size limit and path discovery. Every sentence earns its place.

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 single-file read tool, annotations cover the safety profile, the schema fully documents parameters, and the output schema covers return shape. The description adds the workflow, the size failure mode, and path discovery, so nothing essential is missing for correct invocation.

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 the baseline is 3; the description adds little parameter-specific meaning beyond what the schema already documents. It does usefully point to get_site.filePaths for discovering valid paths, but that is more contextual guidance than semantic detail about the parameters themselves.

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 concrete operation: 'Return the bytes of one file currently served by the site.' The singular 'one file' and 'served by the site' clearly distinguish this from source-file readers and the plural read_files sibling, so an agent can tell what it does without ambiguity.

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?

The description provides a clear workflow: 'call read_file → modify → update_site mode:"patch"' and directs agents to discover valid paths from get_site.filePaths. It does not explicitly name when-not-to-use alternatives like read_files or read_source_file, so it stops just short of full exclusion guidance.

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.