Skip to main content
Glama

get_coverage_for_file

Retrieve line, branch, and function coverage metrics for specific files or path patterns to identify untested code areas and analyze project health.

Instructions

Get coverage metrics for a specific file or files matching a path pattern.

When using a user API Key (gaf_), you must provide a projectId. Use list_projects first to find available project IDs.

Parameters:

  • projectId: The project to query (required)

  • filePath: File path to search for (exact or partial match)

Returns:

  • Line coverage (covered/total/percentage)

  • Branch coverage (covered/total/percentage)

  • Function coverage (covered/total/percentage)

This is the preferred tool for targeted coverage analysis. Use path prefixes to focus on specific areas of the codebase:

  • "server/services" - Backend service layer

  • "server/utils" - Backend utilities

  • "src/api" - API routes

  • "lib/core" - Core business logic

Before querying, explore the codebase to identify critical paths - entry points, heavily-imported files, and code handling auth/payments/data mutations. Prioritize: high utilization + low coverage = highest impact.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID to get coverage for. Required. Use list_projects to find project IDs.
filePathYesFile path to get coverage for. Can be exact path or partial match.

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/gaffer-sh/mcp'

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