Skip to main content
Glama
wallter

smart-xdebug-mcp

by wallter

inspect_variable

Inspect a PHP variable's value at a paused debug breakpoint. Use JSONPath filters to retrieve specific properties or nested data efficiently.

Instructions

Inspects a PHP variable's value at the current breakpoint. Only works when session is PAUSED.

WHEN TO USE:

  • After hitting a breakpoint (status="paused")

  • To examine specific values causing bugs

  • To understand object structure before filtering

CONTEXT EFFICIENCY - Full dumps are expensive. Use JSONPath filters: BAD (returns thousands of lines): inspect_variable("$order") GOOD (returns only what you need): inspect_variable("$order", "$.total") inspect_variable("$order", "$.items[*].sku") inspect_variable("$request", "$.input.email")

Without a filter, returns structure only (keys/types, no values).

JSONPATH EXAMPLES:

  • '$.property' - Single property

  • '$.items[0]' - First array element

  • '$.items[*].id' - All IDs in items array

  • '$.user.profile.name' - Nested property

REQUIRES: Session must be paused. Call get_session_status to verify.

COMMON VARIABLES:

  • '$this' - Current object instance

  • '$request' - HTTP request (Laravel)

  • '$_GET', '$_POST', '$_SERVER' - PHP superglobals

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesPHP variable name including $. Examples: '$this', '$request', '$user', '$_SERVER'
depthNoRecursion depth for nested objects. Default 1, max 3. Higher values return more data but cost more context.
filterNoJSONPath to filter results. Examples: '$.email', '$.items[0].price', '$.user.name'. Omit for structure-only view.
Behavior5/5

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

The description discloses behavioral traits such as returning structure only without a filter, the expensiveness of full dumps, use of JSONPath filtering, recursion depth limits, and the requirement for a paused session. No annotations are present, so the description carries the full burden.

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 well-structured with clear section headers (WHEN TO USE, CONTEXT EFFICIENCY, JSONPATH EXAMPLES, REQUIRES, COMMON VARIABLES). It is front-loaded with the core purpose and each section provides relevant, non-redundant information.

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?

For a debugging tool with parameters for filtering and depth, and no output schema, the description is complete: covers prerequisites, usage guidelines, efficiency tips, examples, and common variable names.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds significant context: explains the filter parameter with JSONPath syntax and examples, depth with context cost implications, and name with common variable examples.

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 the tool's purpose: 'Inspects a PHP variable's value at the current breakpoint.' It specifies the context (session paused) and distinguishes from sibling tools by focusing on inspection.

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 includes a 'WHEN TO USE' section specifying appropriate scenarios (after hitting a breakpoint, to examine values, to understand object structure) and a 'REQUIRES' condition (session paused) with a suggestion to verify via get_session_status.

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/wallter/smart-xdebug-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server