Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Get Apex Test Results

sf_get_apex_test_results
Read-onlyIdempotent

Retrieve Apex test outcomes from recent runs, with pass/fail status, error details, and coverage. Filter by class, outcome, or specific run.

Instructions

Retrieves Apex test results from the most recent test runs via the Tooling API. Returns pass/fail status, error messages, stack traces, and code coverage for each test method.

className: filter to a specific test class name (optional) outcome: filter by outcome — 'Pass', 'Fail', 'Skip', or omit for all limit: maximum results to return (default: 100)

Returns: class name, method name, outcome, run time (ms), error message, and stack trace for failures.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum results to return
classNameNoFilter to a specific Apex test class
testRunIdNoSpecific test run ID (from sf_run_apex_tests). Omit to get latest run.
outcomeFilterNoFilter by outcomeall
Behavior3/5

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

Annotations already declare readOnlyHint and idempotentHint, so the bar is lower. The description adds useful return-value context (status, errors, stack traces, coverage) but contains a factual discrepancy: it states limit default 100 while schema says 200. This misrepresentation reduces trust.

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

Conciseness3/5

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

The description is reasonably short and front-loaded, but the inline parameter lines duplicate schema fields with errors, adding confusion rather than clarity. The structure could be tighter by omitting repeated parameter info or correcting it.

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

Completeness3/5

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

It covers the main purpose, filters, and return fields, and annotations handle safety. However, it misses testRunId guidance, misstates defaults/outcome options, and with no output schema these gaps are more impactful.

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

Parameters2/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, but the description adds negative value by contradicting schema: 'outcome' omits CompileFail and says 'omit for all' while schema default is 'all', and limit default is wrong. It also ignores testRunId entirely.

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?

Clearly specifies the verb 'Retrieves' and resource 'Apex test results' from recent test runs via the Tooling API, and lists the types of information returned. This distinguishes it from siblings like sf_run_apex_tests (which runs tests) and sf_check_code_coverage (which focuses on 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?

The context is clear: use after test runs, and the testRunId parameter references sf_run_apex_tests, implying the connection. However, it does not explicitly state when not to use or name alternatives, so it loses a point for lack of explicit exclusions.

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