Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Create Platform Event Apex Trigger

sf_create_platform_event_trigger
Idempotent

Create an Apex trigger that processes Salesforce platform events upon insertion, enabling automated record creation, notifications, or external API calls in response to event publication.

Instructions

Creates an Apex trigger that fires when a Platform Event message is received (after insert). Use to process incoming platform events with Apex logic — e.g., creating records, sending notifications, or calling external APIs when an event is published.

triggerName: Apex trigger name eventApiName: Platform event API name, e.g. 'MyEvent__e' body: Apex code body for the trigger apiVersion: Salesforce API version

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesApex trigger body code
apiVersionNoAPI version, e.g. '62.0'66.0
triggerNameYesApex trigger name, e.g. 'HandleMyEvent'
eventApiNameYesPlatform event API name, e.g. 'MyEvent__e'
Behavior3/5

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

The description adds useful context beyond annotations, such as 'fires when a Platform Event message is received (after insert)' and example applications. However, it does not disclose potential side effects like overwriting an existing trigger, deployment requirements, or permission necessities. Annotations already indicate it is a write operation (readOnlyHint: false) and idempotent (idempotentHint: true), so the additional behavioral burden is only partially met.

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 front-loaded. The first sentence states the purpose, the second provides use cases, and the parameter list is simple and scannable. No wasted words or redundant information.

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?

For a 4-parameter creation tool with full schema coverage and annotations, the description is adequate. It covers the what, when, and parameter meanings. The main gap is the lack of information about post-creation behavior (e.g., whether the trigger is automatically active or needs deployment), which is not covered by annotations or output schema.

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 coverage is 100%, with each parameter already including examples and descriptions (e.g., eventApiName: 'Platform event API name, e.g. MyEvent__e'). The description repeats these parameter details without adding new semantics beyond the schema. No additional parameter-specific guidance is provided.

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 verb 'Creates' and specifies a unique resource: 'an Apex trigger that fires when a Platform Event message is received (after insert)'. This distinguishes it from the generic sf_create_apex_trigger sibling and other create_* tools.

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 explains when to use the tool: 'Use to process incoming platform events with Apex logic' and gives concrete examples. It does not explicitly mention alternatives or exclusions, but the use cases provide clear context for selection.

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