Skip to main content
Glama

Drush Php Eval

drush_php_eval

Run custom PHP code through Drush to inspect or modify a Drupal site, enabling scripted debugging, data checks, and advanced operations.

Instructions

Execute arbitrary PHP code via Drush.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden, and it discloses almost nothing: no warning that this executes unsandboxed code with full Drupal/PHP privileges, no statement about side effects, reversibility, or whether the code runs after bootstrap. 'Arbitrary' is the only signal of risk, which is insufficient for a tool this powerful.

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?

A single front-loaded sentence with zero filler, which is appropriately sized for one parameter. It is arguably too terse for a code-execution tool, but nothing in it is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values need not be explained, but for an unrestricted code-execution tool with no annotations the description should at minimum state execution context and risk. As written, an agent cannot tell what environment the code runs in or what it could damage.

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 0% and the single parameter has no description, so the description must compensate. It partially does by indicating the parameter is PHP code, but it omits format details such as whether `<?php` tags are required, whether it is a snippet or full script, and whether output/return is captured.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Execute), resource (arbitrary PHP code), and mechanism (via Drush), so an agent knows exactly what happens. It does not, however, distinguish itself from close siblings like drush_command, ddev_exec, or db_query, which can also run code or commands against the site.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to prefer this over drush_command, db_query, or the many structured tools in the sibling list, nor any exclusions or prerequisites. The word 'arbitrary' hints at the breadth of use but the agent must infer the conditions itself.

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