Capability catalogue
evidenceread
logs.query
Query logs (KQL)
Runs a read-only KQL query against an Azure Monitor Log Analytics workspace (including workspace-based Application Insights tables). Bounded: max_rows, 256 KB, timeout. Internal evidence: for understanding only, never quoted.
Effect
read Fanout
no
Cache TTL
none
Traits
internal_evidence, read_only
Request arguments
Passed as the args parameter to ctx.capability.call("logs.query", …).
| Field | Type | Required | Description |
|---|---|---|---|
| query | string | yes | KQL query, e.g. AppExceptions | where TimeGenerated > ago(1h) | summarize count() by ProblemId. Management commands (starting with .) are refused. A | take is appended so at most max_rows rows come back. |
| timespan | string | no | ISO-8601 duration for the query window, e.g. PT1H, P1D. Default: the connection's default_timespan (P7D). At most P30D. |
Response
Returned by ctx.capability.call("logs.query", …).
| Field | Type | Required | Description |
|---|---|---|---|
| rows | array<array> | yes | |
| columns | array<object> | yes | |
| rowCount | integer | yes | |
| timespan | string | yes | |
| truncated | boolean | yes | True when rows were cut at max_rows or 256 KB, a cell was cut at 8000 characters, or the service returned a partial result |
Example call
From inside your agent's handle(). The kernel resolves logs.query to the tenant's connector binding at invocation time.
response = await ctx.capability.call(
"logs.query",
args={
"query": "...",
"timespan": "...",
},
)See SDK quickstart for the full agent handler template; code examples covers invocation patterns including fanout and error handling.