Skip to main content
Glama

get_variables

Retrieve PHP variables during debugging sessions to inspect local variables, superglobals, or user constants at specific execution points.

Instructions

Get all variables at the current execution point. Use context_id to switch between local variables, superglobals, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_idNoContext ID: 0=Local variables, 1=Superglobals, 2=User constants
stack_depthNoStack frame depth (0 = current frame)
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 the tool retrieves variables but doesn't disclose behavioral traits such as whether it's read-only, what permissions are needed, how it handles errors, or the format of the returned data. The description adds minimal context beyond the basic action.

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 two concise sentences that are front-loaded with the main purpose and followed by parameter guidance. Every sentence earns its place with no wasted words, making it efficient and easy to parse.

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?

Given no annotations and no output schema, the description is incomplete for a tool with 3 parameters that likely returns complex variable data. It covers the basic action and parameter hints but lacks details on return values, error handling, or operational constraints, which are important for a debugging-related tool in this sibling set.

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 fully documents the parameters (context_id, stack_depth, session_id). The description adds some meaning by explaining context_id usage ('to switch between local variables, superglobals, etc.'), but doesn't provide additional semantics beyond what the schema already covers. Baseline 3 is appropriate given high schema coverage.

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 action ('Get all variables') and the scope ('at the current execution point'), which is specific and actionable. However, it doesn't explicitly differentiate from its sibling 'get_variable' (singular), which appears to retrieve a specific variable rather than all variables.

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

Usage Guidelines3/5

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

The description provides some usage context by mentioning 'Use context_id to switch between local variables, superglobals, etc.', which implies when to adjust parameters. However, it lacks explicit guidance on when to use this tool versus alternatives like 'get_variable' or 'get_contexts', and doesn't mention prerequisites or exclusions.

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