Summary
When running KQL queries for optimization purposes, it's useful to have access to execution statistics (CPU, memory, cache, network, extents scanned, etc.) returned by the Kusto SDK alongside query results.
Proposed Change
Add an opt-in show_stats: bool = False parameter to kusto_query and kusto_graph_query. When True, extract statistics from the QueryCompletionInformation tables in the SDK response and include them as a top-level statistics key in the tool response.
Statistics included
- Execution time (server + total)
- CPU usage
- Peak memory
- Cache hits/misses (hot/cold)
- Network bytes
- Extents scanned / deleted / orphaned, rows scanned
- Result size
- Per-cluster cross-cluster breakdown
Motivation
Enables query optimization agents to understand query cost without needing a separate profiling step.
Related prior art: microsoft/mcp#1787
Summary
When running KQL queries for optimization purposes, it's useful to have access to execution statistics (CPU, memory, cache, network, extents scanned, etc.) returned by the Kusto SDK alongside query results.
Proposed Change
Add an opt-in
show_stats: bool = Falseparameter tokusto_queryandkusto_graph_query. WhenTrue, extract statistics from theQueryCompletionInformationtables in the SDK response and include them as a top-levelstatisticskey in the tool response.Statistics included
Motivation
Enables query optimization agents to understand query cost without needing a separate profiling step.
Related prior art: microsoft/mcp#1787