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"),
      },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions executing a query but doesn't describe what happens—e.g., whether it returns a list of work items, potential errors like invalid WIQL syntax, rate limits, or authentication needs. This is inadequate for a tool with mutation-like implications (query execution).

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?

The description is a single, efficient sentence in Spanish, making it appropriately sized and front-loaded. However, it could be more concise by specifying the language (WIQL) or adding minimal context without becoming verbose.

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 complexity of query execution, lack of annotations, and no output schema, the description is incomplete. It doesn't explain return values (e.g., work item lists), error conditions, or how it differs from sibling query tools, leaving significant gaps for an AI agent to understand its full context.

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%, so the schema already documents both parameters (wiql and getDetails). The description adds no additional meaning beyond what the schema provides, such as examples of WIQL queries or when to use getDetails. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose3/5

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

The description states the tool 'executes a custom WIQL query in Azure DevOps,' which provides a basic verb+resource combination. However, it's vague about what WIQL is (Work Item Query Language) and doesn't distinguish this from sibling tools like ado_query_area or ado_query_sprint, which also execute queries but with different scopes or parameters.

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. It doesn't mention prerequisites, such as needing a valid WIQL query, or compare it to siblings like ado_query_area for area-based queries or ado_get_work_item for single-item retrieval, leaving the agent without context for selection.

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

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