List Debug Logs
sf_get_debug_logsFetch recent Apex debug logs via Salesforce Tooling API. Filter by user, operation, or count to pinpoint errors and monitor Apex execution.
Instructions
Lists recent Apex debug logs (ApexLog records) via the Tooling API. Use sf_enable_debug_logs first if no logs are showing up — Salesforce only logs activity for users with an active trace flag.
username: filter to logs generated by this username (optional) operation: filter by operation substring, e.g. 'execute_anonymous_apex' (optional) limit: maximum log entries to return (default 10, max 100)
Returns log metadata (ID, start time, duration, status, operation) but not the log content — pass a logId to sf_get_debug_log_body to read the full log.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of log entries to return | |
| username | No | Filter logs to this username (omit to list logs from all users) | |
| operation | No | Filter by operation substring, e.g. 'execute_anonymous_apex' |