Skip to main content
Glama
Chrome DevTools Debug MCP Server

Chrome DevTools Debug MCP Server

by m4eba

get_script_source

Retrieve the source code of a loaded script by script ID, with optional start and end lines to inspect specific code sections during debugging.

Instructions

Get the source code of a script.

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": {
      "scriptId": "<scriptId>"
    },
    "name": "get_script_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
endLineNoEnding line to return (exclusive)
scriptIdYesScript ID
startLineNoStarting line to return (0-based)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and does not meet it. It does not disclose whether the source is fetched live or from cache, whether large scripts are truncated, whether a debugger or target connection is required, or how line ranges interact with the result.

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?

A single front-loaded sentence with no filler, which is appropriate for a simple read tool. It is efficient rather than padded, though the terseness leaves useful context unstated.

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

Completeness2/5

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

The tool is simple (three flat params, one required) and has no output schema, so the description should at minimum characterize the returned content and the effect of the optional line bounds. With no annotations and no output schema, one sentence leaves the agent under-informed about return shape and preconditions.

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 scriptId, startLine, and endLine are already documented with their 0-based and exclusive semantics. The description adds no additional meaning such as defaults when startLine/endLine are omitted or how out-of-range values behave, so the baseline 3 applies.

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 (get) and resource (source code of a script), which is unambiguous on its own. It does not distinguish itself from adjacent retrieval siblings such as get_document, get_outer_html, or get_attributes, so the agent must infer the boundary from the names alone.

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

Usage Guidelines2/5

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

There is no guidance on when to call this versus other inspection tools, no prerequisites (e.g. whether the script must be loaded or a target attached), and no exclusions. The single sentence only says what it returns.

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

Deploy Server

Other Tools