Kommander writes audit records for MCP tool calls so administrators can trace which tool ran, which conversation triggered it, whether it succeeded, how long it took, and which connector or verified identity was involved.
Log Location
Tool audit records are stored in MongoDB in the tool_audit_logs collection. The admin console reads the same collection through:
- UI:
/admin/tool-audit-logs - API:
GET /api/admin/tool-audit-logs
Conversation debugging also links tool calls to their audit entries when conversation messages contain tool-call metadata.
Recorded Fields
| Field | Description |
|---|---|
userId | Kommander user that owned the request. |
organizationId | Organization context when available. |
conversationId | Conversation that triggered the tool call. |
toolName | Tool function name requested by the model. |
toolCallId | Provider tool-call ID. |
correlationId | Stable correlation key combining turn and tool-call ID. |
success | Boolean success flag. |
status | One of success, error, rate_limited, budget_exceeded, timeout, circuit_open, or ownership_check_failure. |
arguments | Redacted tool arguments. |
result | Redacted tool result. |
connectorId | Connector identifier for customer-data tools. |
connectorType | Connector type such as openapi. |
verifiedUserId | Verified end-user audit identifier when available. |
durationMs | Execution duration measured by the tool-call handler. |
errorMessage | Sanitized failure summary for failed calls. |
eventType | tool_call or ownership_check_failure. |
timestamp | Audit event time. |
metadata | Extra diagnostic data for ownership and limit events. |
Redaction
Audit writes redact common sensitive fields in both arguments and results before persistence. The default redaction list includes fields such as authorization, apiKey, bearerToken, cookie, credentials, email, firstName, lastName, fullName, phone, password, secret, token, userHash, and payment or identity document fields.
Customer-data connectors can add connector-specific redaction keys with metadata.config.sensitiveFields.
Query and Export
The admin API returns JSON and accepts filter query parameters:
curl -H "Authorization: Bearer $ADMIN_TOKEN" \
"https://app.kommander.ai/api/admin/tool-audit-logs?conversationId=conversation_123&limit=200"Supported filters are:
| Query parameter | Description |
|---|---|
id | Exact audit log document ID. |
userId | Kommander user ID. |
toolName | Exact tool name. |
toolCallId | Provider tool-call ID. |
connectorId | Customer-data connector ID. |
correlationId | Correlation ID. |
conversationId | Conversation ID. |
success | true or false. |
status | Tool status value. |
startDate | ISO date lower bound. |
endDate | ISO date upper bound. |
limit | Result limit from 1 to 500. Defaults to 200. |
The API response is the supported application-level export format. For operational exports outside the app, export the MongoDB tool_audit_logs collection directly with the same filters and treat redacted fields as the canonical persisted values.
Indexes
The audit collection creates indexes for common investigations:
| Index | Purpose |
|---|---|
timestamp | Recent audit review. |
userId, timestamp | User-level investigation. |
toolName, timestamp | Tool-level diagnostics. |
connectorId, timestamp | Connector-level diagnostics. |
correlationId | Single call correlation. |
conversationId, timestamp | Conversation debugging. |
toolCallId | Provider tool-call lookup. |
Audit writes are best effort. A failed audit insert is logged server-side and does not make the user-facing tool call fail.