Skip to content

KustoClient

Attributes

ClusterName module-attribute

ClusterName = str

DatabaseName module-attribute

DatabaseName = str

Query module-attribute

Query = str

ChartType module-attribute

ChartType = Literal['Html Table', 'Pie Chart', 'Time Chart', 'Bar Chart']

Classes

Table dataclass

Table(value: Optional[List[Row]] = None)

Response for Run KQL query

VisualizeResults dataclass

VisualizeResults(body: Optional[str] = None, body_html: Optional[str] = None, attachment_content: Optional[str] = None, attachment_name: Optional[str] = None, kusto_deep_link: Optional[str] = None)

Response for Run KQL query and render a chart

Attributes

body class-attribute instance-attribute
body: Optional[str] = None

The body of the result in base64 encoding.

body_html class-attribute instance-attribute
body_html: Optional[str] = field(default=None, metadata={'wire_name': 'bodyHtml'})

The body of the result in html encoding.

attachment_content class-attribute instance-attribute
attachment_content: Optional[str] = field(default=None, metadata={'wire_name': 'attachmentContent'})

The content of the attachment.

attachment_name class-attribute instance-attribute
attachment_name: Optional[str] = field(default=None, metadata={'wire_name': 'attachmentName'})

The name of the attachment file.

kusto_deep_link: Optional[str] = field(default=None, metadata={'wire_name': 'kustoDeepLink'})

Links to run the query in Kusto tools, for instance in KustoExplorer.

AsyncCommandResult dataclass

AsyncCommandResult(state: Optional[str] = None, status: Optional[str] = None, operation_id: Optional[str] = None)

Response for Run async control command

Attributes

state class-attribute instance-attribute
state: Optional[str] = None

The state of the command.

status class-attribute instance-attribute
status: Optional[str] = None

The status of the command.

operation_id class-attribute instance-attribute
operation_id: Optional[str] = field(default=None, metadata={'wire_name': 'operationId'})

The operation ID of the control command

MCPQueryResponse dataclass

MCPQueryResponse(jsonrpc: Optional[str] = None, id: Optional[str] = None, method: Optional[str] = None, params: Optional[Dict[str, Any]] = None, result: Optional[Dict[str, Any]] = None, error: Optional[Dict[str, Any]] = None)

Response for Kusto Query MCP Server

ObjectEntity dataclass

ObjectEntity(additional_properties: Dict[str, Any] = dict())

Response for Query schema

Attributes

additional_properties class-attribute instance-attribute
additional_properties: Dict[str, Any] = field(default_factory=dict)

Dynamic properties determined at runtime (similar to .NET [JsonExtensionData])

Row dataclass

Row(additional_properties: Dict[str, Any] = dict())

Definition: Row

Attributes

additional_properties class-attribute instance-attribute
additional_properties: Dict[str, Any] = field(default_factory=dict)

Dynamic properties determined at runtime (similar to .NET [JsonExtensionData])

QueryAndVisualizeSchema dataclass

QueryAndVisualizeSchema(cluster: Optional[ClusterName] = None, db: Optional[DatabaseName] = None, csl: Optional[Query] = None, chart_type: Optional[ChartType] = None)

Definition: QueryAndVisualizeSchema

CommandAndVisualizeSchema dataclass

CommandAndVisualizeSchema(cluster: Optional[ClusterName] = None, db: Optional[DatabaseName] = None, csl: Optional[str] = None, chart_type: Optional[ChartType] = None)

Definition: CommandAndVisualizeSchema

Attributes

csl class-attribute instance-attribute
csl: Optional[str] = None

Specify the control command you would like to run

QueryAndListSchema dataclass

QueryAndListSchema(cluster: Optional[ClusterName] = None, db: Optional[DatabaseName] = None, csl: Optional[Query] = None)

Definition: QueryAndListSchema

ControlCommandAndListSchema dataclass

ControlCommandAndListSchema(cluster: Optional[ClusterName] = None, db: Optional[DatabaseName] = None, csl: Optional[str] = None)

Definition: ControlCommandAndListSchema

Attributes

csl class-attribute instance-attribute
csl: Optional[str] = None

Specify the show control command you would like to run

MCPQueryRequest dataclass

MCPQueryRequest(jsonrpc: Optional[str] = None, id: Optional[str] = None, method: Optional[str] = None, params: Optional[Dict[str, Any]] = None, result: Optional[Dict[str, Any]] = None, error: Optional[Dict[str, Any]] = None, callback_endpoint: Optional[str] = None)

Definition: MCPQueryRequest

KustoClient

KustoClient(connection_runtime_url: str, token_provider: Optional[TokenProvider] = None, options: Optional[ConnectorClientOptions] = None)

Bases: ConnectorClientBase

Typed client for kusto connector.

Initialize a KustoClient.

Parameters:

Name Type Description Default
connection_runtime_url str

The connection runtime URL from Azure Portal.

required
token_provider Optional[TokenProvider]

Optional token provider. Defaults to ManagedIdentityTokenProvider.

None
options Optional[ConnectorClientOptions]

Optional connector client options.

None

Methods:

list_kusto_results_async async
list_kusto_results_async(input: QueryAndListSchema) -> dict[str, Any] | None

Run KQL query

Runs the KQL query and returns the result as a set of rows which can be iterated over in the following connectors e.g TableName | take 10.

list_kusto_show_command_results_async async
list_kusto_show_command_results_async(input: ControlCommandAndListSchema) -> dict[str, Any] | None

Run show control command

Runs the show control command and returns the result as a set of rows which can be iterated over in the following connectors e.g .show table TableName policy caching.

run_kusto_query_and_visualize_results_async async
run_kusto_query_and_visualize_results_async(input: QueryAndVisualizeSchema) -> dict[str, Any] | None

Run KQL query and render a chart

Runs the KQL query and returns result as a chart of your choice e.g TableName | where Timestamp > ago(1h) | project timestamp, value.

run_kusto_command_and_visualize_results_async async
run_kusto_command_and_visualize_results_async(input: CommandAndVisualizeSchema) -> dict[str, Any] | None

Run control command and render a chart

Runs the control command and returns the result as a chart of your choice e.g .clear table TableName data.

run_async_control_command_and_wait_async async
run_async_control_command_and_wait_async(input: ControlCommandAndListSchema) -> dict[str, Any] | None

Run async control command

Runs control command in async mode and returns its ID, state and status on completion. Command can run for maximum 1 hour. The 'async' keyword is mandatory e.g .set-or-append async TargetTable <| SourceTable.

mcp_kusto_query_management_async async
mcp_kusto_query_management_async(input: MCPQueryRequest, session_id: Optional[str] = None) -> dict[str, Any] | None

Kusto Query MCP Server

This MCP server runs Kusto queries and manages the results.

list_kusto_results_schema_async async
list_kusto_results_schema_async(input: QueryAndListSchema) -> dict[str, Any] | None

Query schema

Gets the schema for a query