Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Check Apex Code Coverage

sf_check_code_coverage
Read-onlyIdempotent

Retrieve Apex coverage stats from Tooling API to see which classes meet the 75% deployment threshold. Filter by class or coverage level to identify under-tested code.

Instructions

Retrieves Apex code coverage statistics from the org using the Tooling API. Shows which classes meet or fail the 75% coverage threshold required for deployment. Use after running Apex tests to assess coverage.

className: optional filter to show only classes matching this name minCoverage: optional threshold — only return classes below this coverage percentage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
classNameNoFilter by Apex class name (partial match)
minCoverageNoOnly show classes below this coverage %
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and non-destructive. The description adds useful context beyond annotations: it uses the Tooling API, applies a 75% deployment threshold, and implies it only reads existing test results (does not run tests). This additional behavioral context is meaningful for an agent.

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

Conciseness5/5

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

The description is concise: two sentences cover purpose and usage, followed by a brief parameter breakdown. Every sentence adds value—no filler or repetition. It is well-structured and front-loaded with the primary action.

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 simple read-only tool with two optional parameters and no output schema, the description adequately covers purpose, usage, threshold, and parameters. It does not describe the exact return format, but given the lack of output schema and the simplicity, this is not a critical gap. It could mention limitations like pagination, but that's optional.

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?

Schema description coverage is 100%, so baseline is 3. The description restates the parameter meanings ('partial match', 'below this coverage percentage') nearly identically to the schema. It adds the word 'optional' but does not provide deeper semantics like format or behavior when parameters are omitted, which is already covered by the schema.

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

Purpose5/5

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

The description clearly states the tool's action: 'Retrieves Apex code coverage statistics from the org using the Tooling API' and specifies what it shows ('which classes meet or fail the 75% coverage threshold'). It distinguishes itself from sibling tools like sf_run_apex_tests and sf_get_apex_test_results by focusing on coverage statistics rather than test execution or results.

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

Usage Guidelines4/5

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

The description provides a clear usage context: 'Use after running Apex tests to assess coverage.' This tells the agent when to invoke the tool. However, it does not explicitly mention alternatives or when not to use it, though the 'use after' phrasing implies it complements (not replaces) test-running tools.

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

Install Server

Other Tools

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/semwalajay83-sem/salesforce-metadata-mcp'

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