Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

wit_get_query

Retrieve a specific query by its ID or path from an Azure DevOps project. Customize the response with options to expand details, adjust depth, include deleted items, and use ISO date format.

Instructions

Get a query by its ID or path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
depthNoOptional depth parameter to specify how deep to expand the query. Defaults to 0.
expandNoOptional expand parameter to include additional details in the response. Defaults to 'None'.
includeDeletedNoWhether to include deleted items in the query results. Defaults to false.
projectYesThe name or ID of the Azure DevOps project.
queryYesThe ID or path of the query to retrieve.
useIsoDateFormatNoWhether to use ISO date format in the response. Defaults to false.

Implementation Reference

  • The handler function that executes the logic for the wit_get_query tool, retrieving query details from Azure DevOps WorkItemTrackingApi.
    async ({ project, query, expand, depth, includeDeleted, useIsoDateFormat }) => {
      const connection = await connectionProvider();
      const workItemApi = await connection.getWorkItemTrackingApi();
    
      const queryDetails = await workItemApi.getQuery(project, query, safeEnumConvert(QueryExpand, expand), depth, includeDeleted, useIsoDateFormat);
    
      return {
        content: [{ type: "text", text: JSON.stringify(queryDetails, null, 2) }],
      };
    }
  • Zod input schema defining parameters for the wit_get_query tool.
    {
      project: z.string().describe("The name or ID of the Azure DevOps project."),
      query: z.string().describe("The ID or path of the query to retrieve."),
      expand: z
        .enum(getEnumKeys(QueryExpand) as [string, ...string[]])
        .optional()
        .describe("Optional expand parameter to include additional details in the response. Defaults to 'None'."),
      depth: z.number().default(0).describe("Optional depth parameter to specify how deep to expand the query. Defaults to 0."),
      includeDeleted: z.boolean().default(false).describe("Whether to include deleted items in the query results. Defaults to false."),
      useIsoDateFormat: z.boolean().default(false).describe("Whether to use ISO date format in the response. Defaults to false."),
    },
  • Registration of the wit_get_query tool (via WORKITEM_TOOLS.get_query) on the McpServer instance, including schema and handler.
    server.tool(
      WORKITEM_TOOLS.get_query,
      "Get a query by its ID or path.",
      {
        project: z.string().describe("The name or ID of the Azure DevOps project."),
        query: z.string().describe("The ID or path of the query to retrieve."),
        expand: z
          .enum(getEnumKeys(QueryExpand) as [string, ...string[]])
          .optional()
          .describe("Optional expand parameter to include additional details in the response. Defaults to 'None'."),
        depth: z.number().default(0).describe("Optional depth parameter to specify how deep to expand the query. Defaults to 0."),
        includeDeleted: z.boolean().default(false).describe("Whether to include deleted items in the query results. Defaults to false."),
        useIsoDateFormat: z.boolean().default(false).describe("Whether to use ISO date format in the response. Defaults to false."),
      },
      async ({ project, query, expand, depth, includeDeleted, useIsoDateFormat }) => {
        const connection = await connectionProvider();
        const workItemApi = await connection.getWorkItemTrackingApi();
    
        const queryDetails = await workItemApi.getQuery(project, query, safeEnumConvert(QueryExpand, expand), depth, includeDeleted, useIsoDateFormat);
    
        return {
          content: [{ type: "text", text: JSON.stringify(queryDetails, null, 2) }],
        };
      }
    );
  • Constant mapping defining the MCP tool name 'wit_get_query' for the get_query tool.
    get_query: "wit_get_query",
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the basic action of retrieving a query, lacking details on permissions, rate limits, error handling, or response format. This is insufficient for a tool with multiple parameters and no output schema.

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 a single, direct sentence with no wasted words, making it highly concise and front-loaded. It efficiently communicates the core purpose without unnecessary elaboration.

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

Completeness2/5

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

Given the tool's complexity (6 parameters, no annotations, no output schema), the description is inadequate. It doesn't explain behavioral aspects, usage context, or return values, leaving significant gaps for the agent to infer or guess.

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?

The description mentions retrieving by 'ID or path', which aligns with the 'query' parameter, but adds minimal value beyond the schema. With 100% schema description coverage, the baseline is 3, as the schema already documents all parameters thoroughly.

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 clearly states the action ('Get') and resource ('a query by its ID or path'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'wit_get_query_results_by_id' or 'wit_get_work_item', which also retrieve data but for different resources.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context for selecting this over similar tools like 'wit_get_query_results_by_id', or any exclusions, leaving the agent without usage direction.

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

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ennuiii/DevOpsMcpPAT'

If you have feedback or need assistance with the MCP directory API, please join our Discord server