Skip to main content
Glama

Read the error log

wp_get_error_log
Read-onlyIdempotent

Read the last lines of WordPress's debug.log to diagnose PHP errors, warnings and notices. Returns the requested line count and log text, or an availability notice when no readable log exists.

Instructions

Return the last lines of wp-content/debug.log, where WordPress writes PHP errors, warnings and notices when WP_DEBUG_LOG is on, for diagnosing failures. Read-only; returns available, lines (the count returned) and log (the lines as one text). Without a readable file there it answers available=false with a message, not an error; a log written to another path is not read. The log can hold file paths, queries and data plugins wrote into it. Requires manage_options and runs only with write access on.

Input Schema

NameRequiredDescriptionDefault
linesNoHow many trailing lines to return, 1 to 500 (values outside are clamped). Default 100.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds material context beyond them: the return shape (available, lines, log), that a missing file yields available=false with a message rather than an error, the manage_options capability requirement, the dependence on write access being on, and a warning that the log may contain paths, queries and plugin-written data.

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-loads what file is read and why, then layers the return contract, auth requirement and sensitivity caveat. Densest passage is one long paragraph, but each sentence carries distinct operational value, so it stays efficient rather than padded.

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, and the description compensates by naming the three returned fields and the non-error failure mode. Auth, environment preconditions and content-sensitivity are all covered, leaving nothing an agent needs in order to call it correctly.

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 coverage is 100%, and the schema already documents the 1–500 clamp and the default of 100, so baseline 3 applies. The description does not add syntax for the input; its mention of "lines (the count returned)" actually refers to the output field of the same name, and the name collision with the input parameter risks mild confusion.

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 — returns the trailing lines of wp-content/debug.log — and explains what that file contains (PHP errors, warnings, notices when WP_DEBUG_LOG is on). No sibling in the list touches logs, and the description makes the diagnostic purpose unmistakable.

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?

Gives a clear use case ("for diagnosing failures") and an explicit scope exclusion ("a log written to another path is not read"), which prevents a wrong attempt. It does not name an alternative tool, but no sibling covers this ground, so there is little to route against.

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

Deploy Server

Other Tools