Skip to main content
Glama
kusto-mcp

kusto-mcp

by johnib

execute-query

Run KQL queries against Azure Data Explorer to retrieve row-limited results for data exploration, incident investigation, or reporting; initialize the cluster connection first.

Instructions

Runs KQL queries and returns results. No cluster is configured: call initialize-connection before the first query. If you have not inspected the table yet, call show-table first to see its columns. By default, limits results to 20 rows to prevent context overflow. Use the "limit" parameter to specify a different maximum. If results are marked as partial, consider revising your query to use aggregations, filters, or summarizations. Avoid the search operator on large tables; it often times out. Filter a specific table with where/has instead. Optionally set "purpose" to the closest intent.

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": {
      "query": "<query>",
      "limit": "<limit>"
    },
    "name": "execute-query"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitYesMaximum number of rows to return (default: 20, at most 10000)
queryYesThe query to execute
purposeNoOptional analytics hint: why you are running this query, e.g. schema_discovery, point_lookup, exploration, incident_investigation, service_health, reporting_pipeline, bulk_extract, validation, other. Omit if unsure. Never put query text or names here.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.20.3
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of rows to return (default: 20)"New value: +"Maximum number of rows to return (default: 20, at most 10000)"
    • addedInput schema / properties / limit / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • changedInput schema / properties / limit / type
      Previous value: -"number"New value: +"integer"
  2. Changed1 schema field changedv1.19.0
    • changedInput schema / properties / purpose / description
      Previous value: -"Optional analytics hint: why you are running this query, e.g. schema_discovery, point_lookup, exploration, incident_investigation, service_health, reporting_pipeline, bulk_extract, other. Omit if unsure. Never put query text or names here."New value: +"Optional analytics hint: why you are running this query, e.g. schema_discovery, point_lookup, exploration, incident_investigation, service_health, reporting_pipeline, bulk_extract, validation, other. Omit if unsure. Never put query text or names here."
  3. Changed1 schema field changedv1.18.2
    • addedInput schema / properties / purpose
      Added value: +{
      +  "description": "Optional analytics hint: why you are running this query, e.g. schema_discovery, point_lookup, exploration, incident_investigation, service_health, reporting_pipeline, bulk_extract, other. Omit if unsure. Never put query text or names here.",
      +  "type": "string"
      +}
  4. First observedv1.10.2

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are supplied, so the description carries the full behavioral burden; it discloses the initialization prerequisite, the default 20-row cap to prevent context overflow, partial-result signaling, and search timeout risk. It does not fully state read-only/side-effect guarantees, error behavior, or the precise result shape, leaving some gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads purpose and operational prerequisites with short, direct sentences. Some space repeats schema-known details, especially the default limit and purpose parameter, but no sentence is seriously wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a query-execution tool with no annotations and no output schema, the description covers setup, pre-inspection, row limiting, partial-result handling, and operator pitfalls. It is complete enough to invoke correctly, though result format and error semantics remain undocumented.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents query, limit default, and purpose hints. The description adds rationale that the limit prevents context overflow and that purpose is optional closest intent, but beyond those small additions it largely restates parameter behavior, fitting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Starts with a specific verb and resource: 'Runs KQL queries and returns results.' It also distinguishes its role from siblings by routing setup to initialize-connection and schema inspection to show-table, so an agent can identify it as the query-execution tool without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly gives prerequisites: call initialize-connection before the first query and show-table before querying an uninspected table. It also provides a when-not/alternative for large tables by warning against the search operator and recommending where/has filtering instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.