Skip to main content
Glama

get_variables

Retrieve variables from a debug session by scope reference. Oversized values are truncated; fetch specific variables by name for full access.

Instructions

Get variables (scope is variablesReference: number). Responses are size-guarded: oversized values are cut (truncated:true) and very large scopes return a capped list with a truncation notice — pass names:[...] to fetch specific variables in full

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namesNoOnly return variables with these exact names (case-sensitive). Requested names missing from the scope are listed in the response's notFound.
scopeYesThe variablesReference number from a StackFrame or Variable
sessionIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.25.1
    • addedInput schema / properties / names
      Added value: +{
      +  "description": "Only return variables with these exact names (case-sensitive). Requested names missing from the scope are listed in the response's notFound.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. First observed

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden and discloses important traits: responses are size-guarded, oversized values are cut with truncated:true, and very large scopes return a capped list with a truncation notice. It stops short of documenting permissions, error cases, or the notFound behavior that only appears in the schema.

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?

Two dense sentences with no filler; the core purpose and scope come first, followed by the truncation behavior and the names escape hatch. The em-dash-heavy phrasing is compact but still readable.

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

Completeness4/5

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

For a read tool with no annotations and no output schema, the description covers the key operational risk (truncation) and the mitigation (names), which is exactly what an agent needs to avoid misreading results. The undocumented sessionId and lack of explicit sibling routing are minor gaps.

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 67%, and the schema itself documents names (including notFound) and scope thoroughly; the description largely restates scope and the names workaround. sessionId remains undocumented in both, so the description does not fully compensate for the coverage gap.

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+resource ("Get variables") and pins the scope to a variablesReference number, so an agent knows exactly what is retrieved. It does not, however, distinguish itself from close siblings like get_local_variables or get_scopes, which also return variable data.

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?

Provides a concrete usage hint — pass names:[...] to fetch specific variables in full when the scope is capped — which tells the agent how to work around truncation. It gives no explicit when-to-use/when-not guidance versus the sibling variable tools (get_local_variables, get_scopes, evaluate_expression), leaving tool selection to inference.

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