Skip to main content
Glama

Read a plugin file

wp_read_plugin_file
Read-onlyIdempotent

Read a file inside an installed plugin's folder; theme and uploads files have their own readers (wp_read_theme_file, wp_read_upload_file). 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. Raw source access: plugin code may contain hardcoded API keys, credentials or other secrets. Requires edit_plugins; runs only with the site's write access on. Forwarded by AlphaBridge Connect to the one site this connection reaches.

Input Schema

NameRequiredDescriptionDefault
fileYesPath relative to the plugin folder, e.g. "includes/class-foo.php", as wp_list_plugin_files 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.
pluginYesPlugin folder name, e.g. "akismet" (the part before the slash in the file wp_list_plugins returns).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / file / description
      Previous value: -"Path relative to the plugin folder."New value: +"Path relative to the plugin folder, e.g. \"includes/class-foo.php\", as wp_list_plugin_files 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."
    • addedInput schema / properties / plugin / description
      Added value: +"Plugin folder name, e.g. \"akismet\" (the part before the slash in the file wp_list_plugins returns)."
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare the read-only/idempotent/non-destructive profile, but the description adds substantial context: the 2 MB whole-file vs slice rule, error on missing files, a security warning about hardcoded secrets, the edit_plugins requirement, and the requirement that site write access be on. This is far beyond the annotation signal and materially affects how an agent should call and interpret it.

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 purpose, then return shape, then size limits, then the security caveat and permissions. Every sentence carries distinct, useful information with no filler.

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 explains the return fields (file, content, bytes, file_size, offset), the size behavior, error conditions, permissions, and routing context. An agent has everything needed to call it correctly.

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, but the description adds meaning by tying offset and length to the 2 MB refusal rule (a slice of at most 2 MB is allowed). That interaction is arguably already in the schema, so it earns a 4 rather than 5.

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 inside an installed plugin's folder') and immediately distinguishes it from the sibling readers (wp_read_theme_file, wp_read_upload_file). An agent can pick this tool over its near-neighbors without opening the 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?

Explicitly routes theme and uploads files to their own dedicated tools, leaving plugin-file reads here. The conditions for selection are named directly rather than implied.

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