Skip to main content
Glama
LokiMCPUniverse

Salesforce MCP Server

salesforce_execute_apex

Execute anonymous Apex code in Salesforce to run custom logic, tests, and data operations on the fly, without deployment.

Instructions

Execute anonymous Apex code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orgNo
apex_bodyYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior1/5

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

No annotations are provided, so the description carries full responsibility for disclosing behavioral traits. Executing anonymous Apex can trigger side effects such as data modification, DML operations, and side effects on shared org resources, but the description says nothing about these risks, required permissions, or potential governor limits. This is a dangerous gap for a code-execution tool.

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

Conciseness2/5

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

The description is extremely short, but this is under-specification rather than effective conciseness. It contains only the bare verb and resource, with no additional context or structure. A one-sentence description can be appropriate, but here it wastes the opportunity to convey critical usage details.

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

Completeness1/5

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

Given that this tool executes arbitrary code with potential side effects, the description is grossly incomplete. It lacks usage context, parameter semantics, behavioral disclosures, and any mention of return format (despite having an output schema). The description would be inadequate for even a simple read tool, and is severely deficient for a code-execution tool.

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

Parameters1/5

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

Schema description coverage is 0%, and the description does not reference any parameter names or meanings. Although 'apex_body' is inferable from 'Apex code', the optional 'org' parameter and format expectations (e.g., full Apex script vs. single statements) are completely unexplained. The description adds no value to the bare schema.

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 'Execute anonymous Apex code' clearly states the verb (execute) and the resource (anonymous Apex code), which is specific and distinguishes this from sibling tools like salesforce_query or salesforce_create_record. The term 'anonymous Apex' precisely identifies the Salesforce feature and makes the tool's purpose unambiguous.

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 description provides no guidance on when to use this tool versus alternatives. It doesn't mention scenarios like running dynamic code, debugging, or performing bulk operations, nor does it state exclusions or prerequisites. Users are left without any indication of appropriate use cases.

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

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