Create Trace Flag
apexlog_create_trace_flagCreate a Salesforce trace flag for a user, class, or trigger to capture debug logs until it expires, with optional duration and debug levels; overlapping flags of the same log type are refused.
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 a flag of its log type overlaps the new one. Leaves a debug level in the org.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"tracedEntity": "<tracedEntity>"
},
"name": "apexlog_create_trace_flag"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| targetOrg | No | Alias or username of the target Salesforce org. Uses the project default if not specified. | |
| debugLevel | No | A level for every category, or the named ones over apexlog_execute_anonymous's defaults (default: those) | |
| tracedEntity | Yes | A username or user id, or a class or trigger name (ns.Name if namespaced) | |
| durationMinutes | No | How long it logs (default: 30) |