Skip to main content
Glama

get_variable

Retrieve PHP variable values during debugging sessions, supporting nested properties with PHP syntax for detailed inspection.

Instructions

Get a specific variable by name, including nested properties. Use PHP syntax for nested access (e.g., '$user->name', '$array[0]', '$obj->items[2]->value')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesVariable name with $ prefix (e.g., '$user', '$data["key"]', '$obj->property')
context_idNoContext ID
stack_depthNoStack frame depth
max_depthNoMaximum depth for nested properties
session_idNoSession ID
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions 'including nested properties' and PHP syntax, which adds some behavioral context, but fails to disclose critical traits: it doesn't specify if this is a read-only operation, what permissions are required, how errors are handled (e.g., if the variable doesn't exist), or the return format. For a tool with 5 parameters and no annotation coverage, this is a significant gap.

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?

The description is concise and front-loaded, stating the core purpose in the first clause. The second sentence provides necessary technical detail (PHP syntax) without redundancy. It avoids fluff and wastes no words, though it could be slightly more structured by separating usage notes from syntax examples.

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?

Given the complexity (5 parameters, no annotations, no output schema), the description is incomplete. It lacks information on behavioral aspects like error handling, return values, and interaction with sibling tools. While the schema covers parameters well, the description doesn't compensate for missing annotation and output schema context, making it inadequate for a tool in a debugging environment.

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 documents all parameters thoroughly. The description adds minimal value beyond the schema: it implies the 'name' parameter supports PHP syntax for nested access, which is partially covered in the schema's description ('Variable name with $ prefix...'). However, it doesn't explain the semantics of other parameters like 'context_id' or 'stack_depth', leaving the schema to do the heavy lifting.

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?

The description clearly states the tool's purpose: 'Get a specific variable by name, including nested properties.' It specifies the verb 'Get' and resource 'variable', and distinguishes it from sibling tools like 'get_variables' (plural) by focusing on a single variable. However, it doesn't explicitly differentiate from other variable-related tools like 'evaluate' or 'set_variable' beyond the 'get' action.

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?

The description provides no guidance on when to use this tool versus alternatives. It mentions PHP syntax for nested access, which is a technical detail, but doesn't indicate scenarios where this tool is preferred over siblings like 'get_variables' (for listing) or 'evaluate' (for evaluating expressions). There's no mention of prerequisites, such as needing an active debugging session.

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