chrome_query_selector
Finds elements by CSS selector in a Chrome tab and returns their HTML or a chosen attribute. Use it to inspect or verify page elements directly via the DevTools Protocol.
Instructions
Find element(s) by CSS selector and return their HTML
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": {
"selector": "<selector>"
},
"name": "chrome_query_selector"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Find all matches (default: false, first only) | |
| tabId | No | ||
| selector | Yes | CSS selector | |
| attribute | No | Return specific attribute instead of outerHTML |