Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Run Apex Tests

sf_run_apex_tests
Read-only

Run Apex test classes and get pass/fail results with error messages. Use after deployment to verify test coverage or for regression testing before release.

Instructions

Runs one or more Apex test classes and returns pass/fail results with any error messages. Uses the Salesforce Tooling API runTestsAsynchronous endpoint and polls for results. Use after deploying Apex code to verify test coverage, or to run regression tests before a release.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testClassesYesList of test class names to run, e.g. ['AccountServiceTest', 'ContactTriggerTest']
waitMinutesNoMax minutes to wait for test results
Behavior4/5

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

The description adds valuable behavioral detail beyond the annotations: it uses the Tooling API runTestsAsynchronous endpoint and polls for results. This is important for an agent to understand the potentially long-running, asynchronous nature. The annotations already declare readOnlyHint=true and destructiveHint=false, and the description does not contradict them.

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 three sentences, front-loaded with the primary action, and every sentence adds value (what it does, how it does it, when to use it). No wasted words or redundancy.

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?

The description explains the return value (pass/fail with errors), the asynchronous mechanism, and the main use cases. With no output schema, it provides enough information for an agent to understand what to expect. It doesn't detail the full response shape, but that's acceptable given the tool's simplicity and the presence of a sibling for retrieving detailed results.

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 input schema covers 100% of parameter descriptions, including testClasses and waitMinutes with types, defaults, and constraints. The description adds no additional parameter semantics beyond what the schema already provides, so baseline 3 is appropriate.

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 runs Apex test classes and returns pass/fail results with errors. It uses the specific verb 'runs' and names the resource (Apex test classes), distinguishing it from the sibling tool sf_get_apex_test_results which would retrieve already-run 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 explicitly states when to use it: after deploying Apex code to verify coverage, or before a release for regression tests. It provides clear context but does not enumerate alternatives or explicitly state when not to use it, so it stops short of a full 5.

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