Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Create Apex Test Class

sf_create_apex_test_class
Idempotent

Create and deploy Apex test classes with @isTest annotation. Optionally run tests immediately to verify coverage and support production deployments.

Instructions

Creates and deploys an Apex Test Class (annotated with @isTest). Provide the full test class source code. Optionally run the tests immediately after deployment. Test classes are required for Salesforce deployments to production (minimum 75% code coverage). Use for unit testing Apex classes, triggers, and business logic.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
classBodyYesFull test class source code including @isTest annotation and class declaration
classNameYesTest class name, e.g. 'AccountServiceTest'
apiVersionNoAPI version for this test class66.0
runAfterDeployNoImmediately run the tests after deploying
Behavior4/5

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

Annotations indicate the operation is not read-only and is idempotent, which aligns with the description's 'Creates and deploys' statement. The description adds context by mentioning optional test execution after deployment and the production coverage requirement, which goes beyond the annotations. No contradictions with annotations.

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 and well-structured, with each sentence delivering distinct value: purpose, required input, optional behavior, deployment context, and use cases. It is front-loaded with the core purpose and contains no filler or repetition.

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 tool has no output schema, but the description covers the core behavior, use case, and an important constraint (75% code coverage for production). It omits minor details like API versioning or deployment failure behavior, but these are either in the schema or not critical. It is adequately complete for a creation tool.

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 reinforces the classBody parameter ('Provide the full test class source code') and runAfterDeploy ('Optionally run the tests immediately after deployment'), but these mainly echo schema descriptions. It does not add significant new semantics beyond what the schema already documents.

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 purpose: 'Creates and deploys an Apex Test Class (annotated with @isTest).' It uses a specific verb and resource, and distinguishes it from sibling tools like sf_create_apex_class (which creates regular Apex classes) by emphasizing the test class annotation and deployment.

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 clear context for when to use the tool: 'Use for unit testing Apex classes, triggers, and business logic.' It also notes that test classes are required for production deployments, implying necessity. However, it does not explicitly name alternative tools or exclusion scenarios, so it falls short of a 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