Skip to main content
Glama
Playwright DevTools MCP Server

Playwright DevTools MCP Server

by ariangibson

debug_get_page_source

Retrieves the current DOM HTML source of a page for debugging, with options to format indentation and include the DOCTYPE declaration.

Instructions

Get the current DOM HTML source for debugging

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": {
      "contextId": "<contextId>"
    },
    "name": "debug_get_page_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
prettyNoFormat the HTML with proper indentation
contextIdYesBrowser context ID from browser_launch
includeDoctypeNoInclude the DOCTYPE declaration

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

B3.2/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 entire behavioral burden and does not meet it. It never states that this is a read-only, non-mutating operation, that the referenced context must be live (the contextId comes from browser_launch), or that the returned source can be very large.

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 zero filler; the action and resource lead and the qualifier trails. It is efficient, though its brevity is close to under-specification rather than optimal pruning.

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

Completeness3/5

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

For a simple read tool with fully documented parameters and an obvious return value (HTML source), the definition is barely sufficient. The gaps are behavioral rather than structural: no statement of read-only semantics, context preconditions, or output size characteristics.

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 every parameter (pretty, contextId, includeDoctype) is already documented in the schema with defaults. The description adds no additional meaning such as how pretty interacts with includeDoctype, so the baseline of 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 and resource: 'Get the current DOM HTML source', with the use case ('for debugging') attached. 'HTML source' also implicitly separates it from the sibling debug_get_dom_tree, though it never names that alternative explicitly.

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?

'For debugging' implies the context in which to reach for this tool, but there is no explicit when-not guidance and no routing to debug_get_dom_tree or debug_get_element_properties when a structured tree or element detail would be preferable.

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