{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Persist query for later use.","properties":{"path":{"type":"object","properties":{"account_id":{"type":"string","description":"Your Cloudflare account ID."}},"required":["account_id"],"additionalProperties":false},"body":{"type":"object","properties":{"description":{"type":["string","null"],"maxLength":1000,"examples":["Query description"]},"name":{"description":"Query name","type":"string","maxLength":250,"minLength":1},"parameters":{"properties":{"calculations":{"description":"Create Calculations to compute as part of the query.","type":"array","items":{"oneOf":[{"properties":{"alias":{"type":"string"},"key":{"type":"string"},"keyType":{"type":"string","enum":["string","number","boolean"]},"operator":{"type":"string","enum":["count","COUNT"]}},"required":["operator"],"type":"object"},{"properties":{"alias":{"type":"string"},"key":{"type":"string","pattern":"\\S"},"keyType":{"type":"string","enum":["string","number","boolean"]},"operator":{"type":"string","enum":["uniq","max","min","sum","avg","median","p001","p01","p05","p10","p25","p75","p90","p95","p99","p999","stddev","variance","COUNT_DISTINCT","MAX","MIN","SUM","AVG","MEDIAN","P001","P01","P05","P10","P25","P75","P90","P95","P99","P999","STDDEV","VARIANCE"]}},"required":["key","operator"],"type":"object"}]}},"datasets":{"description":"Set the Datasets to query. Leave it empty to query all the datasets.","type":"array","items":{"type":"string"},"examples":[[]]},"filterCombination":{"description":"Set a Flag to describe how to combine the filters on the query.","type":"string","enum":["and","or","AND","OR"]},"filters":{"description":"Configure the Filters to apply to the query. Supports nested groups via kind: 'group'.","type":"array","items":{"$ref":"#/definitions/workers-observability_filter_node"}},"groupBys":{"description":"Define how to group the results of the query.","type":"array","items":{"properties":{"type":{"type":"string","enum":["string","number","boolean"]},"value":{"type":"string"}},"required":["type","value"],"type":"object"}},"havings":{"description":"Configure the Having clauses that filter on calculations in the query result.","type":"array","items":{"properties":{"key":{"type":"string"},"operation":{"type":"string","enum":["eq","neq","gt","gte","lt","lte"]},"value":{"type":"number"}},"required":["key","operation","value"],"type":"object"}},"limit":{"description":"Set a limit on the number of results / records returned by the query","type":"integer","maximum":100,"minimum":0},"needle":{"description":"Define an expression to search using full-text search.","type":"object","properties":{"isRegex":{"type":"boolean"},"matchCase":{"type":"boolean"},"value":{"allOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"maxLength":1000,"type":"string"}]}},"required":["value"]},"orderBy":{"description":"Configure the order of the results returned by the query.","type":"object","properties":{"order":{"description":"Set the order of the results","type":"string","enum":["asc","desc"]},"value":{"description":"Configure which Calculation to order the results by.","type":"string"}},"required":["value"]}},"type":"object"}},"required":["description","name","parameters"]}},"required":["path","body"],"additionalProperties":false,"definitions":{"workers-observability_filter_node":{"description":"Supports nested groups via kind: 'group'.","type":"object","anyOf":[{"properties":{"filterCombination":{"type":"string","enum":["and","or","AND","OR"]},"filters":{"type":"array","items":{"$ref":"#/definitions/workers-observability_filter_node"},"minItems":1},"kind":{"type":"string","enum":["group"]}},"required":["kind","filterCombination","filters"],"type":"object"},{"$ref":"#/definitions/workers-observability_filter_leaf"}]},"workers-observability_filter_leaf":{"description":"A filter condition applied to query results. Use the keys and values endpoints to discover available fields and their values before constructing filters.","type":"object","properties":{"key":{"description":"Filter field name. Use verified keys from previous query results or the keys endpoint. Common keys include $metadata.service, $metadata.origin, $metadata.trigger, $metadata.message, and $metadata.error.","type":"string"},"kind":{"description":"Discriminator for leaf filter nodes. Always 'filter' when present; may be omitted.","type":"string","enum":["filter"]},"operation":{"description":"Comparison operator. String operators: includes, not_includes, starts_with, ends_with, regex. Existence: exists, is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq, gt, gte, lt, lte.","type":"string","enum":["includes","not_includes","starts_with","ends_with","regex","exists","is_null","in","not_in","eq","neq","gt","gte","lt","lte","=","!=",">",">=","<","<=","INCLUDES","DOES_NOT_INCLUDE","MATCH_REGEX","EXISTS","DOES_NOT_EXIST","IN","NOT_IN","STARTS_WITH","ENDS_WITH"]},"type":{"description":"Data type of the filter field. Must match the actual type of the key being filtered.","type":"string","enum":["string","number","boolean"]},"value":{"description":"Comparison value. Must match actual values in your data — verify with the values endpoint. Ensure the value type (string/number/boolean) matches the field type. String comparisons are case-sensitive. Regex uses RE2 syntax (no lookaheads/lookbehinds).","anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"required":["key","operation","type"]}}},"name":"Save query","id":"cloudflare.queries.post","example":{"path":{"account_id":"example"},"body":{"description":"Query description","name":"example","parameters":{}}},"maxRequests":1,"summary":false}}