Skip to main content
Glama

ado_query_wiql

Execute custom WIQL queries in Azure DevOps to retrieve work items, supporting detailed results for project management and reporting tasks.

Instructions

Ejecuta una consulta WIQL personalizada en Azure DevOps

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wiqlYesQuery WIQL completa
getDetailsNoSi es true, obtiene los detalles completos de cada Work Item

Implementation Reference

  • The handler function for the ado_query_wiql tool, which executes a WIQL query against Azure DevOps using the Work Item Tracking API.
    async ({ wiql, getDetails }) => {
      const api = await getWitApi();
      const wiqlQuery: witInterfaces.Wiql = { query: wiql };
    
      const teamContext = { project: currentProject };
      const queryResult = await api.queryByWiql(wiqlQuery, teamContext);
      const workItemRefs = queryResult.workItems || [];
    
      if (workItemRefs.length === 0) {
        return {
          content: [{ type: "text", text: "No se encontraron resultados" }],
        };
      }
    
      if (!getDetails) {
        return {
          content: [{ type: "text", text: formatWorkItemList(workItemRefs) }],
        };
      }
    
      const ids = workItemRefs.map((wi) => wi.id!).filter((id): id is number => id !== undefined);
      const workItems = await api.getWorkItems(ids);
    
      const result = workItems.map((wi) => formatWorkItem(wi)).join("\n---\n");
    
      return {
        content: [{ type: "text", text: result }],
      };
    }
  • src/index.ts:358-367 (registration)
    Registration of the ado_query_wiql tool with its schema definition in the MCP server.
    server.tool(
      "ado_query_wiql",
      "Ejecuta una consulta WIQL personalizada en Azure DevOps",
      {
        wiql: z.string().describe("Query WIQL completa"),
        getDetails: z
          .boolean()
          .optional()
          .describe("Si es true, obtiene los detalles completos de cada Work Item"),
      },

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/soulberto/mcp-azure'

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