Skip to main content
Glama

evaluate

Evaluate PHP expressions in debug sessions to inspect variables, call methods, or perform calculations during PHP debugging with Xdebug.

Instructions

Evaluate a PHP expression in the current context. Returns the result of the expression. Use for calculations, method calls, or inspecting computed values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesPHP expression to evaluate (e.g., '$x + $y', 'count($array)', '$user->getName()', 'array_keys($data)')
stack_depthNoStack frame depth
session_idNoSession ID
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions the tool 'returns the result', it lacks critical details: whether this is a read-only operation (though implied by 'evaluate'), what happens with errors (e.g., syntax errors in expression), security implications of evaluating arbitrary PHP code, or performance characteristics. The description provides basic intent but insufficient operational context.

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?

The description is perfectly concise with three sentences that each earn their place: first states the core action, second specifies the return, third provides usage guidance. No wasted words, and the most important information ('evaluate a PHP expression') comes first.

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

Completeness3/5

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

For a tool with 3 parameters, no annotations, and no output schema, the description is adequate but incomplete. It covers the basic purpose and usage but lacks important behavioral context (error handling, security implications, performance). Given the complexity of evaluating arbitrary PHP code, more disclosure about limitations or risks would be beneficial.

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 schema already fully documents all three parameters. The description adds no additional parameter information beyond what's in the schema (e.g., it doesn't explain the practical meaning of 'stack_depth' or 'session_id' in the evaluation context). This meets the baseline expectation when schema coverage is complete.

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 clearly states the specific action ('evaluate a PHP expression'), resource ('in the current context'), and outcome ('returns the result'). It distinguishes from siblings like 'get_variable' (which retrieves specific variables) or 'set_variable' (which modifies variables) by focusing on dynamic expression evaluation.

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 clear context for when to use this tool ('for calculations, method calls, or inspecting computed values'), which helps differentiate it from tools like 'get_variable' (for direct variable access). However, it doesn't explicitly state when NOT to use it or mention specific alternatives by name.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kpanuragh/xdebug-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server