Code coverage
coverageMeasure unused CSS and JavaScript per file: start recording, exercise the page, then stop to identify code that was not used.
Instructions
Measures unused CSS and JavaScript per file like the DevTools Coverage panel. Call with action "start", exercise the page, then "stop". CSS coverage always works; JavaScript coverage needs the full DevTools channel.
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": {
"action": "<action>"
},
"name": "coverage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Show at most this many files (default 30). | |
| tabId | No | Tab to act on. Defaults to the session target tab (see tab_select). | |
| types | No | What to measure (default both). | |
| action | Yes | Start or stop measuring. | |
| reload | No | Reload the page right after starting, to cover page load (default false). |