Skip to main content
Glama

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

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "properties": {}, "type": "object" }

Implementation Reference

  • 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), }, ], }; }
  • 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), }, ], }; } );
  • Import of the CodeCoverageTracker class used by the tool handler to retrieve coverage data.
    import { CodeCoverageTracker } from '../session/code-coverage.js';

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kpanuragh/xdebug-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server