Skip to main content
Glama
semwalajay83-sem

salesforce-metadata-mcp

Enable Debug Logs for a User

sf_enable_debug_logs

Turn on Apex debug logging for a Salesforce user by creating a DebugLevel and TraceFlag, so new logs can be captured and retrieved.

Instructions

Turns on Apex debug logging for a user by creating a DebugLevel and TraceFlag via the Tooling API. Required before sf_get_debug_logs will return anything new — Salesforce does not log activity unless a trace flag is active for that user.

username: username of the user to trace, e.g. 'ajay@example.com' durationMinutes: how long tracing stays active (default 30, max 1440) debugLevel: Apex code log granularity — FINEST (most verbose, recommended for debugging) down to ERROR

After enabling, have the user (or an automated process) perform the action you want to debug, then call sf_get_debug_logs to list the resulting logs and sf_get_debug_log_body to read one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesUsername of the user to trace, e.g. 'ajay@example.com'
debugLevelNoApex code log granularity for the debug level (applies to ApexCode category; other categories default to a matching verbosity)FINEST
durationMinutesNoHow long the trace flag stays active, in minutes (max 24 hours)
Behavior4/5

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

Annotations already indicate a non-read-only, non-idempotent, open-world mutation. The description adds valuable context about how it mutates (via DebugLevel/TraceFlag), the prerequisite behavior for logging, and duration/verbosity semantics. No contradiction between description and 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: a succinct purpose sentence, a parameter reference block, and a workflow sentence. It is appropriately sized and front-loaded with the core action. Some redundancy with the schema is acceptable but prevents a perfect score.

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?

For a mutating tool with no output schema, the description covers the effect, the required ordering with sibling tools, and practical usage. It omits details like permissions needed or behavior if a trace flag already exists, but overall is sufficient for an AI agent to invoke it correctly.

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?

The input schema has 100% description coverage for all three parameters, including defaults, ranges, and enum values. The description's parameter list mostly repeats the schema, with slight elaboration like 'FINEST ... recommended for debugging' but adds no fundamentally new parameter semantics.

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 clearly identifies the tool as enabling Apex debug logging for a user by creating a DebugLevel and TraceFlag via the Tooling API. It uses a specific verb and resource, and references sibling tools (sf_get_debug_logs, sf_get_debug_log_body), distinguishing it from log retrieval actions.

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

Usage Guidelines4/5

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

The description explicitly states this tool is required before sf_get_debug_logs will return anything new and provides a clear follow-up workflow: enable logging, perform the action, then call the sibling log tools. It does not explicitly list when-not-to-use scenarios, but the context strongly implies the intended usage.

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