Skip to main content
Glama
Azure DevOps MCP Server

Azure DevOps MCP Server

query_analytics

Read-onlyIdempotent

Run guarded read-only Azure DevOps Analytics OData queries and $apply aggregations across work tracking, pipeline, and test entities for historical trends and reporting.

Instructions

Execute guarded read-only Azure DevOps Analytics OData v4 queries and $apply aggregations across Work Tracking, Pipelines, and Test entities (supports Cloud and on-prem Server). IMPORTANT CAVEATS: (1) Analytics has no area-path-level security — users with View analytics permission see work items across all area paths in the project; (2) Analytics data has eventual consistency lag (seconds to minutes behind real-time state) — use REST APIs for real-time checks and OData Analytics for historical trends and aggregations.

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": {
      "entitySet": "<entitySet>"
    },
    "name": "query_analytics"
  }
}

Input Schema

NameRequiredDescriptionDefault
topNoMaximum number of rows to return ($top; default: 100, hard max: 1000).
skipNoNumber of rows to skip ($skip). Prefer nextLink for large datasets.
applyNoOData $apply aggregation pipeline (e.g. "groupby((DateSK,State),aggregate($count as ItemCount))"). Required for all *Snapshot entities.
countNoInclude total matching row count ($count=true, returned as @odata.count).
scopeNoQuery scope: "project" (recommended default) or "organization" (opt-in org/collection-wide query; requires View analytics across projects).project
expandNoOData $expand clause with nested $select (e.g. "AssignedTo($select=UserName)"). Expanding Revisions on WorkItems is blocked (query WorkItemRevisions instead).
filterNoOData $filter expression (e.g. "State eq 'Active' and ChangedDate ge 2026-11-01T00:00:00Z"). DateTimeOffset literals MUST include a timezone offset (Z or ±HH:MM).
selectNoFields to return ($select, max 800 columns). If both select and apply are omitted, a safe bounded default $select is automatically injected.
orderbyNoOData $orderby clause (e.g. "StoryPoints desc").
versionNoAzure DevOps Analytics OData version (default: "v3.0-preview").v3.0-preview
nextLinkNoExplicit same-origin @odata.nextLink URL from a previous query_analytics page. Off-origin URLs are rejected before sending any request.
entitySetYesTarget OData entity set (e.g. "WorkItems", "WorkItemRevisions", "WorkItemSnapshot", "PipelineRuns", "TestResultsDaily"). Plain entity set name only — key addressing like WorkItems(123) is blocked.
projectIdNoProject ID or name (defaults to AZURE_DEVOPS_DEFAULT_PROJECT when scope is "project").
organizationIdNoOptional Azure DevOps organization (Cloud) or collection (Server) override.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.13

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already state readOnlyHint=true, idempotentHint=true, destructiveHint=false, so safety is covered; the description still adds two non-obvious behaviors annotations cannot express: no area-path-level security (View analytics permission exposes all area paths in the project) and eventual-consistency lag of seconds to minutes. The 'guarded' framing is corroborated by the schema's off-origin nextLink rejection and key-addressing block, so nothing contradicts the annotations.

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?

Two sentences, front-loaded with the verb and resource before the caveats, and the caveats are numbered so an agent can scan them. Every clause carries information an agent needs: entity domains, Cloud/Server support, security visibility, and data freshness.

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 14-parameter tool with no output schema, the invocation side is well covered by the fully documented schema plus the description's scope and consistency warnings. The remaining gap is the result shape: nothing says results come back as an OData value array with @odata.count and @odata.nextLink, or that pagination should follow nextLink, which matters for a query tool with no output schema.

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 description coverage is 100% and every one of the 14 parameters, including the version enum and the scope enum, is documented at the schema level with examples and constraints. The description only alludes to '$apply aggregations' generically and adds no syntax or format meaning beyond what the schema already provides, so the baseline of 3 applies.

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

Purpose4/5

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

The description gives a specific verb and resource: 'Execute guarded read-only Azure DevOps Analytics OData v4 queries and $apply aggregations', plus the entity domains covered (Work Tracking, Pipelines, Test). That is far more specific than the tool name alone, but it never names the closest siblings (get_analytics_metrics, get_analytics_schema) to distinguish which one an agent should pick for a metrics-vs-raw-query need.

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?

Caveat (2) gives an explicit when-not-to-use rule with an alternative: use REST APIs for real-time checks, OData Analytics for historical trends and aggregations. Caveat (1) warns about cross-area-path visibility. There is no guidance contrasting this with the sibling analytics tools, so the routing advice stops short of a full 5.

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