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",

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