get_coverage_report
Retrieve current code coverage data to analyze which parts of PHP code were executed during debugging sessions.
Instructions
Get the current code coverage report
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/advanced.ts:481-493 (handler)The handler function for the 'get_coverage_report' tool. It fetches the coverage summary and top 10 hot spots from the CodeCoverageTracker and returns them as a JSON-formatted text content block.async () => { const summary = ctx.coverageTracker.getSummary(); const hotSpots = ctx.coverageTracker.getHotSpots(10); return { content: [ { type: 'text', text: JSON.stringify({ summary, hotSpots }, null, 2), }, ], }; }
- src/tools/advanced.ts:477-494 (registration)Registration of the 'get_coverage_report' MCP tool on the server, with no input parameters (empty schema) and the inline handler function.server.tool( 'get_coverage_report', 'Get the current code coverage report', {}, async () => { const summary = ctx.coverageTracker.getSummary(); const hotSpots = ctx.coverageTracker.getHotSpots(10); return { content: [ { type: 'text', text: JSON.stringify({ summary, hotSpots }, null, 2), }, ], }; } );
- src/tools/advanced.ts:15-15 (helper)Import of the CodeCoverageTracker class used by the tool handler to retrieve coverage data.import { CodeCoverageTracker } from '../session/code-coverage.js';