Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

wit_get_work_item

Retrieve a specific work item by ID from Azure DevOps with optional field selection, historical state, or expanded relations using PAT authentication.

Instructions

Get a single work item by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
asOfNoOptional date string to retrieve the work item as of a specific time. If not provided, the current state will be returned.
expandNoExpand options include 'all', 'fields', 'links', 'none', and 'relations'. Relations can be used to get child workitems. Defaults to 'none'.
fieldsNoOptional list of fields to include in the response. If not provided, all fields will be returned.
idYesThe ID of the work item to retrieve.
projectYesThe name or ID of the Azure DevOps project.

Implementation Reference

  • Executes the tool logic by fetching the specified work item using the Azure DevOps WorkItemTrackingApi and returning it as JSON.
    async ({ id, project, fields, asOf, expand }) => {
      const connection = await connectionProvider();
      const workItemApi = await connection.getWorkItemTrackingApi();
      const workItem = await workItemApi.getWorkItem(id, fields, asOf, expand as unknown as WorkItemExpand, project);
      return {
        content: [{ type: "text", text: JSON.stringify(workItem, null, 2) }],
      };
    }
  • Zod schema defining input parameters for the tool: id (required), project, optional fields, asOf date, and expand options.
      id: z.number().describe("The ID of the work item to retrieve."),
      project: z.string().describe("The name or ID of the Azure DevOps project."),
      fields: z.array(z.string()).optional().describe("Optional list of fields to include in the response. If not provided, all fields will be returned."),
      asOf: z.coerce.date().optional().describe("Optional date string to retrieve the work item as of a specific time. If not provided, the current state will be returned."),
      expand: z
        .enum(["all", "fields", "links", "none", "relations"])
        .describe("Optional expand parameter to include additional details in the response.")
        .optional()
        .describe("Expand options include 'all', 'fields', 'links', 'none', and 'relations'. Relations can be used to get child workitems. Defaults to 'none'."),
    },
  • Direct registration of the 'wit_get_work_item' tool on the McpServer using server.tool() with name from WORKITEM_TOOLS.get_work_item.
    server.tool(
      WORKITEM_TOOLS.get_work_item,
      "Get a single work item by ID.",
      {
        id: z.number().describe("The ID of the work item to retrieve."),
        project: z.string().describe("The name or ID of the Azure DevOps project."),
        fields: z.array(z.string()).optional().describe("Optional list of fields to include in the response. If not provided, all fields will be returned."),
        asOf: z.coerce.date().optional().describe("Optional date string to retrieve the work item as of a specific time. If not provided, the current state will be returned."),
        expand: z
          .enum(["all", "fields", "links", "none", "relations"])
          .describe("Optional expand parameter to include additional details in the response.")
          .optional()
          .describe("Expand options include 'all', 'fields', 'links', 'none', and 'relations'. Relations can be used to get child workitems. Defaults to 'none'."),
      },
      async ({ id, project, fields, asOf, expand }) => {
        const connection = await connectionProvider();
        const workItemApi = await connection.getWorkItemTrackingApi();
        const workItem = await workItemApi.getWorkItem(id, fields, asOf, expand as unknown as WorkItemExpand, project);
        return {
          content: [{ type: "text", text: JSON.stringify(workItem, null, 2) }],
        };
      }
    );
  • Constant object mapping internal tool keys (e.g., get_work_item) to external MCP tool names (e.g., 'wit_get_work_item').
    const WORKITEM_TOOLS = {
      my_work_items: "wit_my_work_items",
      list_backlogs: "wit_list_backlogs",
      list_backlog_work_items: "wit_list_backlog_work_items",
      get_work_item: "wit_get_work_item",
      get_work_items_batch_by_ids: "wit_get_work_items_batch_by_ids",
      update_work_item: "wit_update_work_item",
      create_work_item: "wit_create_work_item",
      list_work_item_comments: "wit_list_work_item_comments",
      get_work_items_for_iteration: "wit_get_work_items_for_iteration",
      add_work_item_comment: "wit_add_work_item_comment",
      add_child_work_items: "wit_add_child_work_items",
      link_work_item_to_pull_request: "wit_link_work_item_to_pull_request",
      get_work_item_type: "wit_get_work_item_type",
      get_query: "wit_get_query",
      get_query_results_by_id: "wit_get_query_results_by_id",
      update_work_items_batch: "wit_update_work_items_batch",
      work_items_link: "wit_work_items_link",
      work_item_unlink: "wit_work_item_unlink",
      add_artifact_link: "wit_add_artifact_link",
    };
  • src/tools.ts:24-24 (registration)
    High-level call to configureWorkItemTools within configureAllTools, which ultimately registers the wit_get_work_item tool.
    configureWorkItemTools(server, tokenProvider, connectionProvider, userAgentProvider);
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Get' implies a read operation, the description doesn't mention authentication requirements, rate limits, error conditions, or what happens with invalid IDs. For a tool with no annotation coverage, this leaves significant behavioral gaps.

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, clear sentence that efficiently communicates the core purpose without unnecessary words. It's appropriately sized for a straightforward retrieval tool and front-loads the essential information.

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

Completeness3/5

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

For a read operation with comprehensive schema coverage (100%) but no output schema, the description is minimally adequate. It states what the tool does but doesn't address behavioral aspects like authentication, error handling, or return format. With no annotations and no output schema, more context would be helpful for safe usage.

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 schema description coverage is 100%, with all 5 parameters well-documented in the schema itself. The description doesn't add any parameter information beyond what's already in the schema, so it meets the baseline of 3 for adequate coverage when schema does the heavy lifting.

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 single work item by ID'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'wit_get_work_items_batch_by_ids' or 'wit_my_work_items', which also retrieve work items but through different mechanisms.

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?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools for retrieving work items (e.g., 'wit_get_work_items_batch_by_ids', 'wit_my_work_items', 'search_workitem'), there's no indication that this is specifically for retrieving a single item by ID versus other retrieval methods.

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