Skip to main content
Glama

appinsights_diagnose_slowness

Read-onlyIdempotent

WHEN: user wants to understand/deduce why a D365 F&O environment feels slow, using the real Application Insights telemetry the environment already emits -- no trace file upload needed. Runs a set of canned KQL queries and assembles one combined report:

  1. X++ exception hotspots (exceptions table) -- top types/messages by count.

  2. Hot custom telemetry events (customEvents table) -- top event names by frequency, plus a duration breakdown for events that carry an ElapsedMilliseconds custom property (covers ALMMonitoring-instrumented FDDs, and any out-of-box signal using the same convention).

  3. Slow web requests/dependencies (requests/dependencies tables) -- only rendered if the workspace actually has data there (uncommon for FnO's own AOS tier, but present for Commerce/Portal/custom web extensions sharing the same App Insights resource). Requires the connection to be configured first via appinsights_set_connection (or server env vars).

Triggers: 'déduire et comprendre les lenteurs', 'why is my environment slow', 'diagnose slowness from App Insights', 'analyse la lenteur avec App Insights', 'performance issue live environment', 'slow environment telemetry'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNoMax rows per section (1-50). Default 15.
lookbackHoursNoHow far back to analyze, in hours (1-720). Default 24.
minDurationMsNoMinimum average duration (ms) for a custom event to be flagged as 'slow'. Default 2000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already carry the safety profile (readOnlyHint, idempotentHint, destructiveHint=false), lowering the bar; the description adds real behavioral context on top: the report-assembly behavior, conditional rendering of section 3 only 'if the workspace actually has data there', and the ElapsedMilliseconds convention used to flag slow events. No contradiction with annotations.

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?

Information is front-loaded with the WHEN purpose, and the numbered sections make the report output easy to anticipate. The trigger-phrase list is slightly redundant (the same intent repeated across languages) but earns its place for multilingual intent matching; no sentence is wasted.

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

Completeness5/5

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

With no output schema present, the description carries the burden of explaining return values — and it does: three clearly enumerated report sections with their source tables (exceptions, customEvents, requests/dependencies), the conditional empty-data behavior, and the connection prerequisite. Combined with full schema parameter ranges, an agent has everything needed to decide on and invoke this tool correctly.

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 description coverage is 100% for all three parameters, so the baseline is 3. The description adds value beyond the schema by explaining the telemetry convention behind minDurationMs: events carrying an 'ElapsedMilliseconds custom property' (ALMMonitoring-instrumented FDDs, out-of-box signals) get the duration breakdown and 'slow' threshold. This ties the parameter to the actual data source rather than restating schema text.

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?

Opens with a specific WHEN and a precise verb-resource pair: it diagnoses why a 'D365 F&O environment feels slow' using 'real Application Insights telemetry the environment already emits'. The three numbered report sections (exception hotspots, hot custom telemetry events, slow web requests/dependencies) concretely define the output and separate it from generic query tools like appinsights_query.

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?

States an explicit trigger condition ('WHEN: user wants to understand/deduce why a D365 F&O environment feels slow') and names the prerequisite (appinsights_set_connection or server env vars). 'No trace file upload needed' implies an alternative that requires trace uploads, but it never explicitly names the competing sibling (e.g., detect_performance_issues), leaving a small inference step.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.