Skip to main content
Glama
advancedcommunities

Salesforce MCP Server

generate_class

Destructive

Creates Apex class files and associated metadata for Salesforce development, saving them to a 'classes' directory or a specified output directory.

Instructions

Generates the Apex *.cls file and associated metadata file. These files must contained in a parent directory called "classes" in your package directory. Either run this command existing directory of this name, or use the --output-dir flag to generate one or point to an existing one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.7.0

TDQS

C2.8/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, so the agent knows this is a writing, non-idempotent operation. The description adds the directory-placement constraint but never says whether an existing class file of the same name is overwritten — the single most important behavioral fact for a destructive generator.

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?

Purpose is front-loaded in one clean sentence, which is good. But the follow-up is garbled ('Either run this command existing directory of this name'), wasting space on awkward and partly unparseable instructions.

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

Completeness2/5

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

For a destructive, open-world generator with no output schema and effectively undocumented nested parameters, the description omits overwrite semantics, success/failure reporting, and reliable parameter naming. What an agent needs in order to call this safely is not covered.

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 coverage is reported at 0% for a nested input object, so the description must compensate. Instead it introduces a CLI-style '--output-dir' flag name that does not match the schema's 'outputDir', and says nothing about the 40-character/letter-start rule for the required name.

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

Purpose4/5

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

States a specific verb+resource: generates the Apex *.cls file plus its metadata file. That distinguishes it from generate_component and generate_trigger by artifact type, though the description never names those siblings to route the agent explicitly.

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

Usage Guidelines2/5

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

The only guidance is about file placement (files 'must' live in a parent 'classes' directory, or use the flag to create/point to one). There is no when-to-use statement, no prerequisites, and no comparison against alternative generators.

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