stop_coverage
Stop tracking code coverage in PHP applications and generate a report to analyze which code paths were executed during debugging sessions.
Instructions
Stop tracking code coverage and get the report
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/advanced.ts:461-474 (handler)The main handler function for the 'stop_coverage' tool. It calls stopTracking on the coverage tracker, gets the summary and report, and returns them as a JSON text content block.async () => { ctx.coverageTracker.stopTracking(); const summary = ctx.coverageTracker.getSummary(); const report = ctx.coverageTracker.generateReport(); return { content: [ { type: 'text', text: JSON.stringify({ summary, report }, null, 2), }, ], }; }
- src/tools/advanced.ts:457-475 (registration)The registration of the 'stop_coverage' MCP tool using server.tool(), including empty input schema and the handler function.server.tool( 'stop_coverage', 'Stop tracking code coverage and get the report', {}, async () => { ctx.coverageTracker.stopTracking(); const summary = ctx.coverageTracker.getSummary(); const report = ctx.coverageTracker.generateReport(); return { content: [ { type: 'text', text: JSON.stringify({ summary, report }, null, 2), }, ], }; } );
- src/session/code-coverage.ts:50-61 (helper)The CodeCoverageTracker.stopTracking() method called by the tool handler. It finalizes the coverage report by setting end time, stopping tracking, updating statistics, and logging.stopTracking(): CoverageReport | null { if (!this.currentReport) return null; this.currentReport.endedAt = new Date(); this.isTracking = false; // Calculate final statistics this.updateStatistics(); logger.info('Code coverage tracking stopped'); return this.currentReport; }