microsoft/fabric-rti-mcp/kql
Claude Code and agent skill by microsoft/fabric-rti-mcp
- vendor
Checking that the SKILL.md file is still in the repository.
KQL language expertise for writing correct, efficient Kusto queries using the Fabric RTI MCP tools. Covers syntax gotchas, join patterns, dynamic types, datetime pitfalls, regex patterns, serialization, memory management, result-size discipline, and advanced functions (geo, vector, graph). USE THIS SKILL whenever writing, debugging, or reviewing KQL queries — even simple ones — because the gotchas section prevents the most common errors that waste tool calls and cause expensive retry cascades. Trigger on: KQL, Kusto, ADX, Azure Data Explorer, Fabric Eventhouse, log analysis, data exploration, time series, anomaly detection, summarize, where clause, join, extend, project, let statement, parse operator, extract function, any mention of pipe-forward query syntax.
Install
npx vskill@latest install microsoft/fabric-rti-mcp/kqlSKILL.md
The same SKILL.md was published earlier as microsoft/fabric-rti-mcp/kql.
KQL Mastery
Try it yourself: All✅examples in this skill can be run against the public help cluster:https://help.kusto.windows.net, databaseSamples(containsStormEvents,SimpleGraph_Nodes/Edges,nyc_taxi, and more).
1. Running KQL with Fabric RTI MCP
Fabric RTI MCP exposes Kusto functionality as MCP tools. Authentication is handled transparently using Azure Identity.
Available tools
| Tool | Purpose | |
|---|---|---|
kusto_query | Execute a KQL query on a database | |
kusto_command | Execute a management command (.show, .create, etc.) | |
kusto_list_entities | List databases, tables, external tables, materialized views, functions, graphs | |
kusto_describe_database | Get schema for all entities in a database | |
kusto_describe_database_entity | Get schema for a specific entity (table, function, etc.) | |
kusto_sample_entity | Get sample data from a table or other entity | |
kusto_graph_query | Execute a graph query using snapshots or transient graphs | |
kusto_ingest_inline_into_table | Ingest inline CSV data into a table | |
kusto_known_services | List configured Kusto services | |
kusto_get_shots | Retrieve semantically similar shots from a shots table | |
kusto_deeplink_from_query | Build a deeplink URL to open a query in the web explorer | |
kusto_show_queryplan | Get the execution plan for a query without running it | |
kusto_diagnostics | Get a best-effort cluster health and capacity summary |
Query vs management commands
KQL has two execution planes, each with its own MCP tool:
| Plane | Tool | Starts with | Examples | ||
|---|---|---|---|---|---|
| Query | kusto_query | Table name, let, print, datatable | `StormEvents \ | where State == "TEXAS"` | |
| Management | kusto_command | .show, .create, .set, .drop, .alter | .show tables, .show table T schema |
Basic usage
Exploration workflow
When encountering a new cluster or database:
- List entities:
kusto_list_entities(cluster_uri, entity_type="tables", database="MyDB") - Get schema:
kusto_describe_database_entity(entity_name="MyTable", entity_type="table", cluster_uri=..., database=...) - Sample data:
kusto_sample_entity(entity_name="MyTable", entity_type="table", cluster_uri=..., sample_size=5) - Count rows:
kusto_query(query="MyTable | count", cluster_uri=..., database=...) - Run analysis:
kusto_query(query="MyTable | where ... | summarize ...", cluster_uri=..., database=...)
2. Dynamic Type Discipline
KQL's dynamic type is flexible but strict in certain contexts. A common mistake is using a dynamic column in summarize by, order by, or join on without casting.
The rule: Any time you use a dynamic-typed column in by, on, or order by, wrap it in an explicit cast.
Self-correction: When you see "is of a 'dynamic' type" in an error, add tostring(), tolong(), or todouble().
3. Join Patterns & Pitfalls
KQL joins have constraints that differ from SQL.
Equality only
KQL join conditions support only `==`. No <, >, !=, or function calls in join predicates.
For range joins, pre-bin values: | extend bin_val = bin(Value, 100), then join on bin_val.
Left/right attribute matching
Both sides of a join on clause must reference column entities only — not expressions, not aggregates.
Cardinality check before large joins
Always check cardinality before joining tables with >10K rows. A cross-join explosion was the source of the single E_RUNAWAY_QUERY error (25K × 195 = potential 4.8M rows).
4. Regex in KQL
KQL handles regex natively — no need for Python.
The extract_all gotcha
Unlike Python's re.findall(), KQL's extract_all requires capturing groups in the regex:
Regex toolkit — don't fall back to Python
| Function | Use case | Example | |
|---|---|---|---|
extract(regex, group, source) | Single match | extract(@"User '([^']+)'", 1, Msg) | |
extract_all(regex, source) | All matches (needs ()) | extract_all(@"(\w+)", Text) | |
parse | Structured extraction | parse Msg with * "User '" Sender "' sent" * | |
matches regex | Boolean filter | where Url matches regex @"^https?://" | |
replace_regex | Find and replace | replace_regex(Text, @"\s+", " ") |
5. Serialization Requirements
Window functions need serialized (ordered) input.
Functions requiring serialization: row_number(), row_cumsum(), prev(), next(), row_window_session().
6. Memory-Safe Query Patterns
The most common memory error. Caused by scanning too much data without pre-filtering.
The progression of safety
Rules for large tables (>1M rows)
- Always start with `| count` to understand table size
- Always `| where` before `| summarize` — filter time range, partition key, or category first
- Never `dcount()` on high-cardinality columns without pre-filtering
- Check join cardinality before executing (see Section 3)
- Use `materialize()` for subqueries referenced multiple times
When you see E_LOW_MEMORY_CONDITION
The query touched too much data. Your options:
- Add
| wherefilters (time range, partition key) - Reduce the number of
bycolumns insummarize - Break into smaller time windows and union results
- Use
| sample 10000for exploratory work instead of full scans
When you see E_RUNAWAY_QUERY
A join or aggregation produced too many output rows. Check join cardinality — one or both sides is too large.
7. Result Size Discipline
Large results slow down analysis. Prevention:
| Query type | Safeguard | |||
|---|---|---|---|---|
| Exploratory | Always end with `\ | take 10 or \ | take 20` | |
| Aggregation | Use `\ | top 20 by ... not unbounded summarize` | ||
| Wide rows (vectors, JSON) | `\ | project` only needed columns | ||
make_list() / make_set() | Avoid on high-cardinality groups (produces huge cells) | |||
| Unknown size | Run `\ | count` first |
The vector trap: Tables with embedding columns (1536-dim float arrays) produce ~30KB per row. Even | take 20 yields 600KB. Always | project away vector columns unless you specifically need them.
With MCP tools: Use kusto_sample_entity for quick data previews. For deeper exploration, use kusto_query with | take N or | top N to bound results.
8. String Comparison Strictness
KQL sometimes requires explicit casts when comparing computed string values — even when both sides are already strings.
This is most common with computed values from geo_point_to_s2cell() and strcat() comparisons. When in doubt, cast with tostring().
9. Advanced Functions
KQL handles these natively — no need for Python:
Vector similarity
Geo operations
Graph queries
Use the kusto_graph_query MCP tool for graph traversal. It automatically handles graph snapshots when available:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 24 May 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/kql/SKILL.md
Popularity
- Repository stars
- 119
- Repository forks
- 78
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 24 May 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/fabric-rti-mcp/kql)