query_flow_logs
Read the bot execution log (flow_execution_log) — the record of what the runtime actually did, and the only place that separates "the action ran" from "the action produced output". Read-only; requires the view_logs permission. Two modes: without groupBy it returns the newest matching rows, with groupBy it returns a grouped rollup ("what is failing right now") — group by error for distinct failures, action for which step, flow for where, day for whether it is new, then re-run with the same filters and no groupBy to read the rows behind a group. The window is always bounded: it defaults to the last 24 hours and cannot exceed 14 days. For one contact's history, get_contact_activity with includeFlowRuns is the narrower read. Rows are redacted: URL query values read ?param=***, HTTP request and response bodies keep their first 200 characters, and SECRET variable values read ******** — a masked value is not a missing one. Besides runtime rows, each deploy writes compile warnings (level WARNING, metadata.stage "compile", action = the kind): config_key_dropped, trigger_config_invalid, start_trigger_blank_command_catch_all, start_trigger_event_unreachable, start_rule_operand_unwritten, listener_triggers_ignored, condition_rules_stored_shape, owner_consistency, http_literal_credential, flow_link_loop. Runtime warnings to search for: variable_not_found, attachment_dropped, blank_button_dropped, reply_answer_mismatch, node_ref_unresolved (the run stopped at a step the published bot does not contain), and a message that was not sent (metadata.deliverySkipReason: owner_not_linked, owner_unreachable, peer_empty, dm_no_subject, target_unsupported).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| botId | No | Only this bot's rows. Omit for every bot in the application. | |
| level | No | Only rows at this level or worse: `WARNING` returns warnings and errors, and is the usual starting point (a failed send is a warning). | |
| limit | No | Rows (max 200, default 50) or groups (max 100, default 25) to return. | |
| action | No | Exact action name, as it appears in the `action` field of a returned row. | |
| flowId | No | Only rows produced while running this flow. | |
| search | No | Substring match on the message or the error message. | |
| blockId | No | Only rows produced by this block. | |
| endDate | No | End of the window, ISO 8601. Defaults to now. | |
| groupBy | No | Return a rollup grouped by this dimension instead of raw rows. | |
| contactId | No | Only rows for this contact — one person's trace through the bot. | |
| startDate | No | Start of the window, ISO 8601. Defaults to 24 hours before endDate. | |
| applicationId | No | Application (workspace) id. Optional: an application-scoped key (app_...) defaults to its own application, but a personal key (usr_...) has no default and omitting it fails with MCP_APPLICATION_REQUIRED. Call list_applications to get the id. |