Skip to main content
Glama
stefanskiasan

Azure DevOps MCP Server for Cline

create_work_item

Create new Azure DevOps work items (Bugs, Tasks, User Stories) by applying JSON patch operations to define fields and properties.

Instructions

Create a new work item using JSON patch operations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesWork item type (e.g., "Bug", "Task", "User Story")
documentYesArray of JSON patch operations to apply

Implementation Reference

  • The main handler function `createWorkItem` that executes the tool logic: validates parameters, sets up Azure DevOps connection, creates the work item using the API, and formats the response as MCP content.
    export async function createWorkItem(args: { type: string; document: JsonPatchOperation[] }, config: AzureDevOpsConfig) {
      if (!args.type || !args.document || !args.document.length) {
        throw new McpError(ErrorCode.InvalidParams, 'Work item type and patch document are required');
      }
    
      AzureDevOpsConnection.initialize(config);
      const connection = AzureDevOpsConnection.getInstance();
      const workItemTrackingApi = await connection.getWorkItemTrackingApi();
    
      const workItem = await workItemTrackingApi.createWorkItem(
        undefined,
        args.document,
        config.project,
        args.type
      );
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(workItem, null, 2),
          },
        ],
      };
    }
  • Input schema and metadata (name, description) for the 'create_work_item' tool.
    {
      name: 'create_work_item',
      description: 'Create a new work item using JSON patch operations',
      inputSchema: {
        type: 'object',
        properties: {
          type: {
            type: 'string',
            description: 'Work item type (e.g., "Bug", "Task", "User Story")',
          },
          document: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                op: {
                  type: 'string',
                  enum: ['add', 'remove', 'replace', 'move', 'copy', 'test'],
                  description: 'The patch operation to perform',
                },
                path: {
                  type: 'string',
                  description: 'The path for the operation (e.g., /fields/System.Title)',
                },
                value: {
                  description: 'The value for the operation',
                },
              },
              required: ['op', 'path'],
            },
            description: 'Array of JSON patch operations to apply',
          },
        },
        required: ['type', 'document'],
      },
    },
  • Registers the `createWorkItem` handler within the `workItemTools` object, which is used by the MCP server for tool execution and provides definitions for listing tools.
    export const workItemTools = {
      initialize: (config: AzureDevOpsConfig) => ({
        getWorkItem: (args: WorkItemBatchGetRequest) => getWorkItem(args, config),
        listWorkItems: (args: Wiql) => listWorkItems(args, config),
        createWorkItem: (args: { type: string; document: JsonPatchOperation[] }) => createWorkItem(args, config),
        updateWorkItem: (args: { id: number; document: JsonPatchOperation[] }) => updateWorkItem(args, config),
        definitions,
      }),
  • src/index.ts:73-90 (registration)
    Top-level initialization of tool instances including workItemTools (which contains create_work_item), and combines definitions from all tool groups for MCP server registration.
    const toolInstances = {
      workItem: workItemTools.initialize(this.config),
      board: boardTools.initialize(this.config),
      wiki: wikiTools.initialize(this.config),
      project: projectTools.initialize(this.config),
      pipeline: pipelineTools.initialize(this.config),
      pullRequest: pullRequestTools.initialize(this.config),
    };
    
    // Combine all tool definitions
    this.toolDefinitions = [
      ...toolInstances.workItem.definitions,
      ...toolInstances.board.definitions,
      ...toolInstances.wiki.definitions,
      ...toolInstances.project.definitions,
      ...toolInstances.pipeline.definitions,
      ...toolInstances.pullRequest.definitions,
    ];
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 states it's a creation tool, implying a write operation, but doesn't cover permissions, side effects, error handling, or response format. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and method, making it easy to parse quickly.

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 a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what a 'work item' is, provide usage context, describe behavioral traits, or hint at the return value, leaving significant gaps for an AI agent to operate effectively.

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 clear documentation for both parameters ('type' and 'document'). The description adds minimal value beyond the schema by mentioning 'JSON patch operations', which aligns with the 'document' parameter's structure, but doesn't provide additional context like examples or constraints beyond what's in the schema.

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 ('Create a new work item') and the method ('using JSON patch operations'), which distinguishes it from sibling tools like 'list_work_items' or 'update_work_item'. However, it doesn't specify what a 'work item' is in this context, leaving some ambiguity about the resource being created.

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. It doesn't mention prerequisites, when to choose this over 'update_work_item', or any context-specific conditions for creating work items, leaving the agent to infer usage from the tool name alone.

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/stefanskiasan/azure-devops-mcp-server'

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