Skip to main content
Glama
chrome-dev-mcp

chrome-dev-mcp

get_inspected_element

Read-only

Retrieve the element marked for inspection in Chrome DevTools to enable AI agents to access its details. Returns an error if no element is marked.

Instructions

Get the element marked for MCP inspection. To mark an element: select it in the Elements panel, then run window.$0 = $0 in the DevTools console. Returns an error if no element is marked.

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault
idNo
tagNameYes
classNameNo
outerHTMLYesFirst 5000 characters of element outerHTML
attributesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.3.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "attributes": {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "className": {
      +      "type": "string"
      +    },
      +    "id": {
      +      "type": "string"
      +    },
      +    "outerHTML": {
      +      "description": "First 5000 characters of element outerHTML",
      +      "type": "string"
      +    },
      +    "tagName": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "tagName",
      +    "attributes",
      +    "outerHTML"
      +  ],
      +  "type": "object"
      +}
  2. First observedv1.1.0

TDQS

A4.5/5.0
Behavior4/5

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

readOnlyHint=true already covers the safety profile, and the description adds real behavioral context beyond that: the prerequisite that an element must be marked first, and the explicit failure mode ('Returns an error if no element is marked'). Not a contradiction — it is a read that depends on prior DevTools console state.

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: what it does, how to satisfy the precondition, and what happens on failure — front-loaded and with no wasted text. The ordering puts the purpose before the setup detail, which is the right priority for an agent scanning tools.

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?

With zero parameters, an output schema already covering the return shape, and readOnlyHint annotations, the only remaining gaps would be preconditions and failure modes — both of which the description supplies. Nothing an agent needs to invoke this correctly is missing.

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

Parameters4/5

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

The tool takes no parameters, so there is nothing for the description to disambiguate; baseline 4 applies. The description usefully clarifies that the 'input' is external DevTools state ($0) rather than a tool argument, which prevents the agent from hunting for a missing parameter.

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?

States a specific verb and resource ('Get the element marked for MCP inspection') and makes the scope distinct from siblings like get_html and get_computed_style, which read arbitrary page state rather than a user-marked element. An agent can tell immediately what this returns 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?

Gives an explicit prerequisite workflow ('select it in the Elements panel, then run `window.$0 = $0` in the DevTools console'), which is exactly the context an agent needs to advise a user on setup. It does not, however, name an alternative for the case where no element is marked (e.g. get_html), so the when-not path is only implied by the error statement.

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