appinsights_query
Run a raw KQL (Kusto) query against the D365FO environment's Application Insights / Log Analytics workspace (read-only -- the query language has no mutation operators). Requires the connection to be configured first via appinsights_set_connection (or server env vars). Use the standard App Insights schema: requests, dependencies, exceptions, traces, customEvents, pageViews, performanceCounters. Prefer appinsights_diagnose_slowness for a ready-made "why is it slow" report -- use this tool for anything more specific/custom.
Triggers: 'run this KQL', 'query app insights', 'requête KQL', 'log analytics query', 'custom App Insights query for my environment'.
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": {
"kql": "<kql>"
},
"name": "appinsights_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kql | Yes | KQL query text, e.g. "exceptions | where timestamp > ago(1h) | take 20". Do NOT include an explicit 'ago()'/time-range filter for the primary time column -- use the lookbackHours parameter instead (applied as the query time range). | |
| maxRows | No | Max rows to return (1-500). Default 100. | |
| lookbackHours | No | How far back to query, in hours (1-720). Default 24. |