Skip to main content
Glama

Variables in a frame

get_scopes

Inspect all variables visible in a stack frame—locals, closures, blocks, modules, and this—with values; expand object refs via get_properties to debug Node.js execution.

Instructions

All variables visible in a frame (local, closure, block, module scopes, plus this), with values. Object values come with a ⟨ref⟩ you can expand with get_properties.

Input Schema

NameRequiredDescriptionDefault
frameNoFrame index from get_stack; 0 is the innermost.
include_globalNoAlso dump the global scope (large).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description must carry the full behavioral burden. It usefully discloses the return shape (variables with values, object values as expandable ⟨ref⟩), but it does not say the operation is read-only, that it has no side effects, or how include_global affects output size (that detail is left to 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the core resource and scope enumeration, then the ref-expansion tip. No filler; every clause adds information.

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 simple two-parameter getter with no output schema and no annotations, the description is largely complete: it says what variables are returned, that values are included, and how object refs work. It could be fuller about read-only behavior and the optional global-scope expansion, but the schema covers the parameter details.

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 both the frame and include_global parameters are already fully documented in the schema. The description adds no parameter-level meaning beyond that, so the baseline of 3 applies.

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 states a specific resource ('all variables visible in a frame') and enumerates the scope types (local, closure, block, module, plus `this`). It also distinguishes itself from the sibling get_properties by pointing to ref expansion, so an agent can tell what it retrieves without opening the schema.

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?

It gives clear workflow context: the frame index comes from get_stack, and object refs are expanded with get_properties. However, it does not explicitly state when to prefer get_scopes over a sibling like evaluate for inspecting values, nor does it name any when-not conditions.

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