Skip to main content
Glama
advancedcommunities

Salesforce MCP Server

get_apex_test_results

Read-only

Retrieve results from a previous asynchronous Apex test run by test run ID, including pass/fail status, errors, stack traces, and optional code coverage.

Instructions

Retrieve results from a previous asynchronous Apex test run. Use this command with a test run ID to get detailed test results including pass/fail status, error messages, stack traces, and optionally code coverage information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
testsYes
summaryYes
targetOrgYes
codecoverageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.7.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already carry the safety profile (readOnlyHint=true, destructiveHint=false), so the bar is lower; the description adds useful content about what is retrieved (pass/fail status, error messages, stack traces, optional coverage). It omits the polling nuance implied by idempotentHint=false — that an async run may still be in progress and results may be incomplete.

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?

Two sentences, zero filler, with the core action front-loaded and the returned payload enumerated second. Nothing needs trimming.

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?

With an output schema present, the description need not detail return values, and it covers the async-retrieval workflow adequately. The one gap is the targetOrg behavior (default-org fallback), which is only discoverable from the schema.

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?

The description matches the schema's testRunId and codeCoverage semantics without adding syntax or format detail beyond them, and it never mentions the targetOrg selector, which the schema documents. With the schema carrying the parameter burden, this is baseline-level.

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?

States a specific verb (Retrieve) and resource (results from a previous asynchronous Apex test run), with the scope narrowed to an existing run rather than starting one. This cleanly separates it from sibling run_apex_tests and from get_apex_code_coverage.

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?

"Use this command with a test run ID" states the prerequisite (a previously executed async run) and what the ID is for. It does not explicitly name an alternative tool or a when-not condition, so it stops short of full routing guidance.

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