Skip to main content
Glama
mcp-php-debugbar
by movinginfo

debugbar_read_source

Read a PHP source file and focus on a specific line to inspect the exact code from an exception stack trace or query backtrace.

Instructions

Read a PHP source file from the project, optionally focusing on a specific line. File paths are resolved against PROJECT_ROOT in .env. Pass a file path from an exception stack trace or query backtrace to see the exact code.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file": "<file>"
    },
    "name": "debugbar_read_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesFile path (absolute or relative to project root)
fullNoRead the full file instead of a context window. Default: false
lineNoTarget line number to focus on
contextNoLines of context around the target line. Default: 15

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses that paths resolve against PROJECT_ROOT in .env, which explains path semantics. However, it does not state that this is a read-only/non-mutating operation, what happens for missing files, whether paths can escape the project root, or any size limits — meaningful gaps for a filesystem-reading tool.

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?

Three short sentences, front-loaded with the action and resource, then path resolution, then the workflow use case. No filler and nothing redundant.

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 read-only file reader with a fully documented schema and no output schema, the description covers purpose, path resolution, and the primary workflow. Missing only minor behavioral details (error handling on missing files, read-only confirmation), which keeps it from a 5.

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 already documents file, full, line, and context with defaults. The description adds only that the file path typically comes from a stack trace/backtrace, which clarifies intent but not syntax or interaction between the line/context/full parameters. Baseline 3 is appropriate.

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?

Specific verb and resource: 'Read a PHP source file from the project' with optional line focusing. An agent can immediately tell this is a file viewer, distinct from the data-fetching siblings like debugbar_get_exceptions. It stops just short of 5 because there is no explicit naming of the sibling tools it relates to (e.g. fetching a stack trace first).

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 concrete usage context: pass file paths from an exception stack trace or query backtrace to see the exact code, which implies the workflow pairing with debugbar_get_exceptions / debugbar_get_queries. It does not state when not to use it or boundaries (e.g. non-PHP files), so it falls short of a full when/when-not treatment.

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