Skip to main content
Glama

Read an uploaded file

wp_read_upload_file
Read-onlyIdempotent

Read a file from the uploads directory (wp-content/uploads). Returns file, content (the raw file content as a string), bytes, file_size and offset. A file up to 2 MB is read whole; a larger one is refused with its size unless offset/length select a slice of at most 2 MB. A missing file is an error. AlphaBridge's own folders (ab-mcp-sessions, ab-mcp-exports, ab-mcp-undo) are refused. Raw filesystem access; administrators only (manage_options); runs only with the site's write access on. Attachment data is read by wp_get_media. Forwarded by AlphaBridge Connect to the one site this connection reaches.

Input Schema

NameRequiredDescriptionDefault
fileYesPath relative to the uploads directory, e.g. "2026/07/report.csv", as wp_list_uploads lists it; ".." and symlinked files are refused.
lengthNoNumber of bytes to read, at most 2 MB per call. Default: up to 2 MB from offset when offset is above 0; otherwise the whole file, which a file over 2 MB is refused for (offset 0 needs a length to read a slice).
offsetNoByte offset to start reading from. Default 0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / file / description
      Previous value: -"Path relative to the uploads directory."New value: +"Path relative to the uploads directory, e.g. \"2026/07/report.csv\", as wp_list_uploads lists it; \"..\" and symlinked files are refused."
    • changedInput schema / properties / length / description
      Previous value: -"Optional number of bytes to read (max 2 MB per call)."New value: +"Number of bytes to read, at most 2 MB per call. Default: up to 2 MB from offset when offset is above 0; otherwise the whole file, which a file over 2 MB is refused for (offset 0 needs a length to read a slice)."
    • changedInput schema / properties / offset / description
      Previous value: -"Optional byte offset to start reading from."New value: +"Byte offset to start reading from. Default 0."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, yet the description still adds real behavior: the 2 MB hard ceiling with refusal semantics, the offset/length slicing escape hatch, missing-file-is-an-error, and the refused internal folders. That is exactly the extra context annotations cannot carry.

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?

Front-loaded with purpose, scope, and return shape, then constraints in descending order of importance; every sentence carries operational weight. It runs slightly long, and the trailing 'Forwarded by AlphaBridge Connect...' sentence is the least load-bearing.

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, so the description compensates by enumerating the returned fields (file, content, bytes, file_size, offset). Combined with size limits, permission gating, and error behavior, 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.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so 3 is the baseline, but the description adds meaning the schema does not make obvious at a glance: the interaction between file size and offset/length, and the consequence of refusal. It stops short of explaining default values or types, which the schema already handles.

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 from the uploads directory (wp-content/uploads)') with an explicit path scope, which separates it from wp_read_plugin_file, wp_read_theme_file, and wp_get_media. The enumerated return fields make the output shape unambiguous.

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?

Names the alternative for the adjacent use case ('Attachment data is read by wp_get_media'), states the access preconditions (administrators only, manage_options, site write access on), and lists the exclusions (AlphaBridge folders refused, over-2MB files refused without a slice). An agent can decide between this and its siblings without opening a schema.

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