Skip to main content
Glama
advancedcommunities

Salesforce MCP Server

get_apex_code_coverage

Read-onlyIdempotent

Retrieve Salesforce Org Apex code coverage to monitor compliance with the 75% requirement. Get org-wide percentages or details from a specific test run.

Instructions

Get code coverage information for a Salesforce Org. This command allows you to retrieve org-wide coverage percentage or coverage details from a specific test run. Use this to monitor and ensure your code meets the 75% coverage requirement.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.7.0

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds the from-tests/org-wide distinction and the conditional requirement of a test run ID, but says nothing about output shape, latency, or org permissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three compact sentences, front-loaded with the core action, then the two modes, then the motivating use case. No filler, though the third sentence is optional context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only query tool with well-documented nested params and annotations covering safety, the description is nearly sufficient; the absence of an output schema means return values need not be spelled out. Only the lack of routing guidance against sibling tools leaves a small gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Top-level coverage is 0% because the schema wraps everything in a nested 'input' object, but the nested properties themselves carry full descriptions (targetOrg default behavior, testRunId requirement, coverageType enum). The description reinforces the two coverage modes but adds no syntax or format detail beyond the nested schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('get code coverage information for a Salesforce Org') and distinguishes its two modes (org-wide percentage vs. coverage from a specific test run). It doesn't explicitly differentiate from siblings like get_apex_test_results, but the purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a context for use ('monitor and ensure your code meets the 75% coverage requirement') but does not say when to prefer this over adjacent tools such as get_apex_test_results or run_apex_tests, nor any exclusion conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.