Skip to main content
Glama

get_variables

Browse PHP variables in scope by listing names, types, and child counts for a chosen context and stack depth.

Instructions

List all variables in scope with metadata (names, types, child counts). Use get_variable() to inspect specific variable values. Returns lightweight metadata for browsing the variable tree.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_idNoContext ID: 0=Local variables, 1=Superglobals, 2=User constants
session_idNoSession ID
stack_depthNoStack frame depth (0 = current frame)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior3/5

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

No annotations are provided, so the description must carry the full burden of disclosing side effects. The description implies a read-only operation by saying 'List' and 'Returns', but it does not explicitly state that it has no side effects or that it does not modify state. Since there are no annotations to rely on, this is a minor transparency gap.

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 sentences long and contains no fluff. It front-loads the core purpose, then provides a pointer to the sibling tool for values. Every word contributes value.

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?

The description specifies what it returns (lightweight metadata with names, types, and child counts) and why it is useful (browsing the variable tree). It also references a sibling tool for value inspection, giving sufficient context for correct usage even without an output schema.

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?

All three parameters have schema descriptions that explain their meaning (context_id, session_id, stack_depth). The tool description itself does not add any extra semantic value beyond the schema, so a baseline score of 3 is appropriate.

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 that the tool lists all variables in scope with metadata, and explicitly distinguishes it from get_variable() which is for inspecting specific values. The verb 'List' and resource 'variables in scope' are specific, and the reference to sibling tool provides clear differentiation.

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

Usage Guidelines5/5

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

The description tells the agent when not to use this tool ('Use get_variable() to inspect specific variable values') and implies when to use it (for browsing the variable tree without retrieving values). This gives clear guidance on choosing between this tool and its sibling.

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