Skip to main content
Glama

query_flow_logs

Read-only

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), mtproto_watched_group_unresolved (a userbot watched-groups row matches no chat, so that chat is never read), and a message that was not sent (metadata.deliverySkipReason: owner_not_linked, owner_unreachable, peer_empty, dm_no_subject, target_unsupported).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "query_flow_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
botIdNoOnly this bot's rows. Omit for every bot in the application.
levelNoOnly rows at this level or worse: `WARNING` returns warnings and errors, and is the usual starting point (a failed send is a warning).
limitNoRows (max 200, default 50) or groups (max 100, default 25) to return.
actionNoExact action name, as it appears in the `action` field of a returned row.
flowIdNoOnly rows produced while running this flow.
searchNoSubstring match on the message or the error message.
blockIdNoOnly rows produced by this block.
endDateNoEnd of the window, ISO 8601. Defaults to now.
groupByNoReturn a rollup grouped by this dimension instead of raw rows.
contactIdNoOnly rows for this contact — one person's trace through the bot.
startDateNoStart of the window, ISO 8601. Defaults to 24 hours before endDate.
applicationIdNoApplication (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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / level / description
      Previous value: -"Only rows at this level. `ERROR` is the usual starting point."New value: +"Only rows at this level or worse: `WARNING` returns warnings and errors, and is the usual starting point (a failed send is a warning)."
  2. Changed1 schema field changed
    • changedInput schema / properties / level / enum
      Previous value: -[
      -  "INFO",
      -  "WARNING",
      -  "ERROR",
      -  "DEBUG"
      -]New value: +[
      +  "INFO",
      +  "WARNING",
      +  "ERROR"
      +]
  3. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint, destructiveHint=false), so credit goes to what is added beyond them: the required view_logs permission, the bounded window (defaults to 24h, hard ceiling of 14 days), and the redaction rules that preempt a common misinterpretation of masked values as absent data. The only notable omission is that it does not discuss result size or ordering beyond "newest matching rows," which the annotations do not cover either.

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?

Front-loaded with the core definition and mode split before the detail, and the long enumerations of compile and runtime warning codes are genuinely usable search targets. It is dense and single-block, and the warning-code catalog is heavy relative to the rest, so it stops short of maximally efficient.

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?

For a 12-parameter, zero-required tool with no output schema, the description carries the full burden and does: it explains what a returned row means, the difference between row and rollup shapes, what got destroyed or masked, and the one exception path (MCP_APPLICATION_REQUIRED) that would otherwise surface as an opaque error.

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?

Schema coverage is 100%, so the baseline is 3, but the description earns more by giving operational meaning to groupBy (which dimension answers which question) and by tying the row-vs-group semantics to limit. It does not add much for the filter parameters beyond what the schema already states, which keeps it below 5.

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?

States a specific verb and resource ("Read the bot execution log (flow_execution_log)") and immediately sharpens it with a distinguishing capability claim: it is "the only place that separates 'the action ran' from 'the action produced output'." It also names the narrower sibling read (get_contact_activity with includeFlowRuns), so an agent can tell these apart without opening either schema.

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?

Explicitly frames the two modes and when each applies: no groupBy returns newest rows, groupBy returns a rollup for "what is failing right now." It goes further and prescribes the investigation workflow (group by error/action/flow/day, then re-run with the same filters and no groupBy to read the rows behind a group), and names the alternative tool plus its condition of use.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.