Skip to main content
Glama
SH-G401
by SH-G401

Query logs (KQL)

azure_logs_query
Read-onlyIdempotent

Run KQL queries against Azure Monitor Logs to investigate application telemetry, errors, and resource logs across workspaces, Application Insights, and specific resources.

Instructions

Runs a KQL query against Azure Monitor Logs. scope can be a Log Analytics workspace (queries the whole workspace), an Application Insights resource, or any other resource (only that resource's logs, from every workspace it sends to). Application Insights tables: AppRequests, AppDependencies, AppExceptions, AppTraces. App Service: AppServiceHTTPLogs, AppServiceConsoleLogs. AKS: ContainerLogV2, KubePodInventory, KubeEvents. Example: {"scope": "", "query": "AppRequests | where Success == false | summarize count() by ResultCode, Name | top 10 by count_"}. Use azure_telemetry_locations to find the right scope.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hoursNoHow many hours to look back (default 24, max 2160).
limitNoMaximum rows (default 100).
queryYesKQL query.
scopeYesResource ID of a Log Analytics workspace, Application Insights resource, or any resource.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover read-only, non-destructive, idempotent behavior. The description adds valuable behavioral context by explaining how the scope parameter affects query results (whole workspace vs. specific resource) and provides example tables for different resource types, going beyond annotation-provided safety hints.

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

Conciseness5/5

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

The description is well-structured and front-loaded with the core action. Every sentence earns its place: scope explanation, table examples, a query example, and a pointer to the helper tool. It is concise despite its length, with no redundancy.

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 complex tool with no output schema, the description covers scope behavior, query examples, and a scope-finding helper. It is sufficiently complete for an agent to call it correctly, though it does not describe the return format or error handling, which are minor gaps given the annotations and schema coverage.

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

Parameters4/5

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

Schema descriptions cover all 4 parameters (100% coverage), but the description enriches the scope parameter with detailed semantics about what each scope type queries and gives a concrete query example. This adds meaning beyond the schema's generic descriptions, though hours/limit are not elaborated beyond schema defaults.

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?

The description clearly states 'Runs a KQL query against Azure Monitor Logs' and elaborates on scope types (workspace, Application Insights, or any resource), making the tool's function unambiguous. It implicitly differentiates from specialized siblings by being the general-purpose KQL tool, and the scope semantics are precise.

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

Usage Guidelines4/5

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

The description gives context on when to use this tool (for arbitrary KQL queries) and explicitly points to azure_telemetry_locations for finding the right scope. However, it does not explicitly mention when to prefer specialized siblings like azure_appservice_logs or azure_containerapp_logs, so it lacks explicit exclusions.

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