Skip to main content
Glama
boejucci

Salesforce MCP Server (Extended)

by boejucci

salesforce_write_apex_trigger

Create or update Apex triggers on Salesforce objects by providing trigger name, object, API version, and body code.

Instructions

Create or update Apex triggers in Salesforce.

Examples:

  1. Create a new Apex trigger: { "operation": "create", "triggerName": "AccountTrigger", "objectName": "Account", "apiVersion": "58.0", "body": "trigger AccountTrigger on Account (before insert, before update) { /* implementation */ }" }

  2. Update an existing Apex trigger: { "operation": "update", "triggerName": "AccountTrigger", "body": "trigger AccountTrigger on Account (before insert, before update, after update) { /* updated implementation */ }" }

Notes:

  • The operation must be either 'create' or 'update'

  • For 'create' operations, triggerName, objectName, and body are required

  • For 'update' operations, triggerName and body are required

  • apiVersion is optional for 'create' (defaults to the latest version)

  • The body must be valid Apex trigger code

  • The triggerName in the body must match the triggerName parameter

  • The objectName in the body must match the objectName parameter (for 'create')

  • Status information is returned after successful operations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYesWhether to create a new trigger or update an existing one
triggerNameYesName of the Apex trigger to create or update
objectNameNoName of the Salesforce object the trigger is for (required for 'create')
apiVersionNoAPI version for the Apex trigger (e.g., '58.0')
bodyYesFull body of the Apex trigger
Behavior3/5

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

No annotations are provided, so the description carries full burden. It discloses that operations are 'create' or 'update' and notes required parameter matches, but does not detail potential side effects (e.g., overwriting existing triggers), permission needs, or error conditions. The mention of 'status information' is vague.

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, starting with a clear purpose statement, followed by two detailed examples, and a bulleted list of important notes. No extraneous information is included, and every sentence contributes value.

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?

Given the tool has 5 parameters, no output schema, and no annotations, the description covers essential aspects: operation types, required/optional fields, and validation rules. However, it lacks details about the response format or error handling, which would be helpful for an action that modifies system state.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds value through examples and notes clarifying operational constraints (e.g., 'For 'create' operations, triggerName, objectName, and body are required') and defaults (e.g., 'apiVersion is optional for 'create' (defaults to the latest version)'), which go beyond the schema's 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 explicitly states 'Create or update Apex triggers in Salesforce,' clearly identifying the verb (create/update) and resource (Apex triggers). Among sibling tools like 'salesforce_write_apex' (for classes) and 'salesforce_read_apex_trigger' (for reading), this tool's purpose is distinct and unambiguous.

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

Usage Guidelines3/5

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

The description does not provide explicit guidance on when to use this tool vs alternatives. While examples illustrate usage, there is no comparison with siblings like 'salesforce_write_apex' or 'salesforce_read_apex_trigger.' The context is clear only through the tool name and purpose.

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

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