Skip to main content
Glama
aaron-pienza

Salesforce MCP Server

by aaron-pienza

salesforce_read_apex

Read Apex classes from Salesforce by name or pattern, with optional metadata. Retrieve full body for a specific class.

Instructions

Read Apex classes from Salesforce.

Examples:

  1. Read a specific Apex class by name: { "className": "AccountController" }

  2. List all Apex classes with an optional name pattern: { "namePattern": "Controller" }

  3. Get metadata about Apex classes: { "includeMetadata": true, "namePattern": "Trigger" }

  4. Use wildcards in name patterns: { "namePattern": "AccountCont" }

Notes:

  • When className is provided, the full body of that specific class is returned

  • When namePattern is provided, all matching class names are returned (without body)

  • Use includeMetadata to get additional information like API version, length, and last modified date

  • If neither className nor namePattern is provided, all Apex class names will be listed

  • Wildcards are supported in namePattern: * (matches any characters) and ? (matches a single character)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
classNameNoName of a specific Apex class to read
namePatternNoPattern to match Apex class names (supports wildcards * and ?)
includeMetadataNoWhether to include metadata about the Apex classes
limitNoMaximum number of classes to return when listing (default 50)
offsetNoNumber of classes to skip for pagination when listing (default 0)
Behavior5/5

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

With no annotations, the description fully discloses behavior: it states the difference between returning full body vs names only, metadata inclusion, wildcard support, and default pagination. No contradictions.

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 well-structured with an introductory sentence, numbered examples, and bullet-point notes. Every sentence adds value, and there is no redundancy. It is appropriately sized for the tool's complexity.

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 no output schema, the description describes return values vaguely (full body, names, metadata). It covers the essentials but could be more precise about the exact structure. Nevertheless, given the examples, it is sufficient for an agent to understand the output.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 100% schema coverage, the description adds significant value by explaining interactions between parameters (e.g., className vs namePattern behavior), wildcard syntax, and default values. This goes beyond the schema's individual field descriptions.

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 starts with 'Read Apex classes from Salesforce,' which is a clear verb+resource. Examples show specific actions like reading by name, listing by pattern, and including metadata. This distinguishes it from siblings like salesforce_write_apex and salesforce_read_apex_trigger.

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 usage guidance through examples and notes, explaining when to use className vs namePattern, and the effect of includeMetadata. It does not explicitly mention when not to use or compare with other tools, but the context is fairly clear.

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/aaron-pienza/mcp-server-salesforce'

If you have feedback or need assistance with the MCP directory API, please join our Discord server