Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

List Debug Logs

sf_get_debug_logs
Read-onlyIdempotent

Fetch 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

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of log entries to return
usernameNoFilter logs to this username (omit to list logs from all users)
operationNoFilter by operation substring, e.g. 'execute_anonymous_apex'
Behavior5/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint. The description adds significant behavioral context beyond annotations: it states the tool returns metadata but not content, requires an active trace flag for logs to appear, and lists the specific metadata fields (ID, start time, duration, status, operation). No contradictions with 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?

The description is well-structured and front-loaded with the main purpose. The parameter list is concise but repeats some schema text. The additional sentences about requiring a trace flag and pointing to sf_get_debug_log_body are valuable and not excessive. Slight redundancy in parameter descriptions prevents a perfect score.

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?

Given no output schema, the description compensates by listing what metadata fields are returned and explicitly excluding log content. It also covers the prerequisite (trace flag) and the relationship to sibling tools (sf_enable_debug_logs and sf_get_debug_log_body). This makes the tool fully understandable in its context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already describes all three parameters at 100% coverage, so the baseline is 3. The description adds extra value by providing an example for operation ('execute_anonymous_apex') and clarifying default/max limits for limit. While largely redundant, the examples and contextual notes enhance understanding beyond the schema.

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 starts with 'Lists recent Apex debug logs (ApexLog records) via the Tooling API,' clearly stating the verb, resource, and API. It distinguishes itself from sibling tools by explicitly mentioning sf_get_debug_log_body for log content and sf_enable_debug_logs for enabling logging.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit when-to-use guidance: 'Use sf_enable_debug_logs first if no logs are showing up' and explains the trace flag prerequisite. It also directs users to sf_get_debug_log_body when full log content is needed, clearly defining this tool's scope versus its sibling.

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