Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Get Apex Trigger Source

sf_get_apex_trigger
Read-onlyIdempotent

Retrieve an Apex trigger's full source code and metadata by exact name, including body, target object, active status, and events. Useful for viewing or modifying an existing trigger.

Instructions

Retrieves the full source code of an existing Apex trigger by exact name, via the Tooling API. Returns the trigger body, the object it fires on, its active status, and which trigger events (before/after insert/update/delete/undelete) it's registered for. Use before modifying a trigger, or when a user asks to see or explain an existing trigger.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
triggerNameYesApex trigger name (exact match), e.g. 'AccountTrigger'
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the agent knows it is safe. The description adds valuable behavioral context: exact-name matching, Tooling API usage, and the specific return payload (body, object, status, events). This goes beyond what annotations provide, but does not discuss errors or exact-match failure behavior.

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 three sentences long, front-loaded with the main purpose, and each sentence provides useful information without redundancy. It includes the retrieval action, return fields, and usage context in a compact manner.

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

Completeness5/5

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

For a simple read-only tool with one parameter, strong annotations, and no output schema, the description fully covers what the tool does, what it returns, and when to use it. There is no missing critical information, making it complete for its complexity level.

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?

The schema covers the single parameter triggerName with a description and example, achieving 100% schema coverage. The description reinforces 'exact name' but does not add new semantic details (e.g., case sensitivity or format) beyond the schema, so it stays at the baseline of 3.

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 tool retrieves the full source code of an existing Apex trigger by exact name via the Tooling API, and lists the specific returned fields (body, object, active status, trigger events). It is distinct from sibling tools like sf_create_apex_trigger or sf_get_apex_class by focusing on reading an existing 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 explicitly says to use it 'before modifying a trigger' or 'when a user asks to see or explain an existing trigger.' This provides clear when-to-use guidance, but it does not explicitly mention alternatives or when not to use it, so it falls short of a 5.

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