Query Worker Logs
query_worker_logsFetches recent log events for a Cloudflare Worker, including messages, outcomes, requests, and timing, to help debug and monitor; observability must be enabled.
Instructions
Query a Worker's logs (Workers Logs / observability). Returns the most recent matching events with message, outcome, request, and timing. The Worker must have observability enabled (deploy_worker's enable_observability or update_worker_settings).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"script_name": "<script_name>"
},
"name": "query_worker_logs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum events to return (default 20) | |
| cursor | No | Pagination cursor: pass the next_cursor from a previous call (with the same filters) to fetch the next page of older events | |
| search | No | Full-text needle matched across all log fields | |
| minutes | No | Look-back window in minutes (default 60; retention is 3–7 days) | |
| errors_only | No | Only return events that carry an error | |
| script_name | Yes | The Worker whose logs to query |