Skip to main content
Glama
certinia

Apex Log MCP Server

Official
by certinia

Create Trace Flag

apexlog_create_trace_flag

Creates a Salesforce trace flag to capture debug logs for a user, class, or trigger until it expires, helping isolate transactions or code paths for Apex log analysis.

Instructions

Trace a user, class or trigger in a Salesforce org until the trace flag expires. A user's flag stores each transaction they run as a debug log, which can fill log storage; a class or trigger flag only sets that code's levels. Refused if one of its log type exists. Leaves a debug level in the org.

Input Schema

NameRequiredDescriptionDefault
targetOrgNoAlias or username of the target Salesforce org. Uses the project default if not specified.
debugLevelNoA level for every category, or the named ones over apexlog_execute_anonymous's defaults (default: those)
tracedEntityYesA username or user id, or a class or trigger name (ns.Name if namespaced)
durationMinutesNoHow long it logs (default: 30)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.2

TDQS

A3.6/5.0
Behavior4/5

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

Annotations only carry destructiveHint=false, so the description must do the heavy lifting — and it does: it warns that a user flag can fill log storage, explains the different effect for class/trigger flags, discloses the refusal condition, and notes the lingering side effect ('Leaves a debug level in the org'). Missing are reversibility/cleanup instructions and permission requirements, but the disclosure goes well beyond annotations.

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

Conciseness4/5

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

Four short sentences, front-loaded with the core action before the caveats. Each sentence carries a distinct fact (effect, storage risk, refusal, residue), though 'Refused if one of its log type exists' is grammatically terse enough to be slightly ambiguous.

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

Completeness3/5

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

No output schema exists, yet the description never says what is returned (e.g., the flag id or debug level handle) that an agent would need for later cleanup. The mutation's side effects are well covered, but the return contract and the 'one of its log type exists' condition are underspecified for an agent to act deterministically.

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%, so the schema already documents all four parameters including the debugLevel unions and duration bounds. The description adds only indirect color ('until the trace flag expires' gesture toward durationMinutes) and no format or syntax details beyond the schema — baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Trace a user, class or trigger') and clarifies the scope ('until the trace flag expires'), which distinguishes it from the read-only siblings like apexlog_get_org_logs. It does not explicitly name any sibling, so the differentiation is implied rather than stated.

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?

Usage context is implied by the fact that it is the only creation tool among list/get siblings, and the refusal condition ('Refused if one of its log type exists') is a useful gating hint. However, there is no explicit when-to-use guidance, no mention of when to prefer this over tracing via execute_anonymous, and no prerequisite/permission statements.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.