Skip to main content
Glama
certinia

Apex Log MCP Server

Official
by certinia

List Slow Apex Log Operations

apexlog_list_slow_operations
Read-only

Ranks Apex debug log operations by self-execution time or retained heap, showing calls, durations, database rows, and query plans so you can identify what to optimize and why.

Instructions

Rank what an Apex debug log spent its time on by self-execution time, or on the heap it retains - code units, methods, queries, searches, DML, callouts, flows and workflows in one table, each row with its calls, durations, database counts and rows, so the caller can see what to optimize and why, beside the query optimizer's plan for the queries among them.

Input Schema

NameRequiredDescriptionDefault
typeNoRank only these log event types, e.g. SOQL_EXECUTE_BEGIN, DML_BEGIN, METHOD_ENTRY
limitNoPage size (default: 10); fewer if the page would be too large
offsetNoRanked rows to skip (default: 0): the last page's nextOffset
sortByNoDefault durationSelfMs. heapSelfNetBytes adds that column.
groupByNoFold repeats into one row; default name. callerNamespace attributes platform DML to the package that drove it. debugCategory folds a namespace's event types together and so states no type or name. none ranks each call on its own. A grouped durationTotalMs is what the transaction takes back if the group never runs - never sum it across rows.
minSelfMsNoDrop operations below this self time (default: 0), whichever sortBy is used
namespaceNoRank only these namespaces
logFilePathYesAbsolute path
debugCategoryNoRank only these debug log categories

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.0.2
    • changedInput schema / properties / offset / description
      Previous value: -"Ranked rows to skip (default: 0). Advance it by the rows you got, which can be fewer than limit."New value: +"Ranked rows to skip (default: 0): the last page's nextOffset"
  2. Addedv2.0.1

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=true and openWorldHint=false, so safety is covered. The description adds output-shape behavior not in the annotations: a single ranked table whose rows carry calls, durations, database counts and rows, plus the query optimizer plan alongside queries. It does not itself mention pagination or the grouped-duration-summing caveat (those live in schema parameter text), so it stops short of a 5.

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?

One front-loaded sentence that leads with the ranking purpose and then the row contents; it is dense but every clause carries information (ranking axes, covered types, row columns, optimizer plan). It runs long and could be split into two sentences for scanability, which keeps it off a 5.

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?

With no output schema, the description usefully compensates by describing the returned table and its columns. Given 9 parameters at 100% schema coverage, the remaining param detail is adequately handled elsewhere. The main gap is that paging behavior and the grouped-duration summing rule are only discoverable by reading parameter descriptions.

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 description coverage is 100%, including enum values, defaults, and even the non-additive durationTotalMs warning, so the schema does the semantic heavy lifting. The description only implicitly maps to sortBy ('by self-execution time, or on the heap it retains') and says nothing about grouping, paging, or filtering parameters. Baseline 3 applies.

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?

Specific verb (rank) plus resource (Apex debug log operations) and the two ranking bases (self-execution time, retained heap). It also enumerates the covered event types (code units, methods, queries, DML, callouts, flows, workflows), so an agent knows exactly what population is ranked. It does not name or contrast with siblings like apexlog_get_summary or apexlog_search_events, leaving that inference to the agent.

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 is implied rather than stated: 'so the caller can see what to optimize and why' signals the performance-tuning scenario but gives no explicit when-to-use or when-not-to-use criteria. No alternative tool is named, so an agent must decide on its own between this, apexlog_get_summary, and apexlog_search_events.

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