Skip to main content
Glama
Azure DevOps MCP Server

Azure DevOps MCP Server

create_commit

Destructive

Commits file changes to an existing Azure DevOps branch using targeted search/replace edits or unified git patches, supporting additions, deletions, and multi-hunk diffs.

Instructions

Create a commit on an existing branch with one change entry per file path (pass plain branch names without "refs/heads/"). Prefer search/replace (path, search, replace) for targeted edits; use unified git patch with numbered @@ -old,len +new,len @@ hunks (and /dev/null headers) for file additions, deletions, or multi-hunk diffs.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "repositoryId": "<repositoryId>",
      "branchName": "<branchName>",
      "commitMessage": "<commitMessage>",
      "changes": "<changes>"
    },
    "name": "create_commit"
  }
}

Input Schema

NameRequiredDescriptionDefault
changesYesFile changes as either search/replace entries or unified git diffs (one entry per file path)
projectIdNoThe ID or name of the project (defaults to AZURE_DEVOPS_DEFAULT_PROJECT)
branchNameYesBranch name to commit to (without "refs/heads/", e.g., "main")
repositoryIdYesThe ID or name of the repository
commitMessageYesCommit message
organizationIdNoThe ID or name of the organization (defaults to configured organization)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv1.0.13
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / description
      Removed value: -"Create a commit on an existing branch using file changes.\n- Provide plain branch names (no \"refs/heads/\").\n\n**RECOMMENDED: Use search/replace format (easier, no line counting needed!)**\n\nOption 1 - Search/Replace (Easiest):\n```json\n{\n  \"changes\": [{\n    \"path\": \"src/file.ts\",\n    \"search\": \"old code here\",\n    \"replace\": \"new code here\"\n  }]\n}\n```\n\nOption 2 - Unified Diff (Advanced):\n- Requires complete hunk headers: @@ -oldStart,oldLines +newStart,newLines @@\n- Include 3-5 context lines before/after changes\n- For deletions: --- a/file, +++ /dev/null\n- For additions: --- /dev/null, +++ b/file"
    • changedInput schema / properties / branchName / description
      Previous value: -"The branch to commit to (without \"refs/heads/\", e.g., \"codex/test2-delete-main-py\")"New value: +"Branch name to commit to (without \"refs/heads/\", e.g., \"main\")"
    • changedInput schema / properties / changes / description
      Previous value: -"List of file changes as either unified git diffs OR search/replace pairs"New value: +"File changes as either search/replace entries or unified git diffs (one entry per file path)"
    • removedInput schema / properties / changes / items / additionalProperties
      Removed value: -false
    • changedInput schema / properties / changes / items / properties / patch / description
      Previous value: -"Unified git diff for a single file.\nMUST include `diff --git`, `--- a/...`, `+++ b/...`, and complete hunk headers.\nCRITICAL: Every hunk header must have line numbers in format: @@ -oldStart,oldLines +newStart,newLines @@\nDo NOT use @@ without the line range numbers - this will cause parsing failures.\nInclude 3-5 context lines before and after changes for proper patch application.\nUse `/dev/null` with `---` for new files, or with `+++` for deleted files.\n\nExample modify patch:\n```diff\ndiff --git a/charts/bcs-mcp-server/templates/service-api.yaml b/charts/bcs-mcp-server/templates/service-api.yaml\n--- a/charts/bcs-mcp-server/templates/service-api.yaml\n+++ b/charts/bcs-mcp-server/templates/service-api.yaml\n@@ -4,7 +4,7 @@ spec:\n spec:\n   type: {{ .Values.service.type }}\n   ports:\n-    - port: 8080\n+    - port: 9090\n     targetPort: deployment-port\n     protocol: TCP\n     name: http\n```"New value: +"Unified git diff for a single file with `diff --git`, `---`/`+++` headers (`/dev/null` for add/delete), numbered `@@ -oldStart,oldLines +newStart,newLines @@` hunks, and 3-5 context lines"
    • changedInput schema / properties / changes / items / properties / path / description
      Previous value: -"File path. Optional for patch format (uses diff header), REQUIRED for search/replace format"New value: +"File path (required for search/replace; optional for patch where the diff header specifies the path)"
    • changedInput schema / properties / changes / items / properties / replace / description
      Previous value: -"Alternative to patch: Exact text to replace the \"search\" string with. Must be used together with \"search\" and \"path\"."New value: +"Exact replacement text for `search` (must be paired with `search` and `path`)"
    • changedInput schema / properties / changes / items / properties / search / description
      Previous value: -"Alternative to patch: Exact text to search for in the file.\nMust be used with \"replace\" and \"path\" fields.\nThe server will fetch the file, perform the replacement, and generate the patch automatically.\nThis is MUCH EASIER than creating unified diffs manually - no line counting needed!\n\nExample:\n\"search\": \"return axios.post(apiUrl, payload, requestConfig);\"\n\"replace\": \"return axios.post(apiUrl, payload, requestConfig).then(r => { /* process */ return r; });\""New value: +"Exact text to find in the file (must be paired with `replace` and `path`)"
    • changedInput schema / properties / organizationId / description
      Previous value: -"The ID or name of the organization (Default: mycompany)"New value: +"The ID or name of the organization (defaults to configured organization)"
    • changedInput schema / properties / projectId / description
      Previous value: -"The ID or name of the project (Default: MyProject)"New value: +"The ID or name of the project (defaults to AZURE_DEVOPS_DEFAULT_PROJECT)"
  2. Addedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, so the agent knows this mutates remote state. The description contributes real constraints — the branch must already exist, plain branch names without "refs/heads/", exactly one entry per path — but never warns about permanence, conflict behavior, or what happens if a search string does not match.

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?

Two sentences, front-loaded with the core action and the one-entry-per-path rule before the mode guidance. Slight duplication of the hunk/header syntax that already appears in the schema keeps it from being fully waste-free.

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

Completeness4/5

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

For a destructive write with full schema coverage and no output schema, the description covers the essentials an agent needs to call it correctly: existing-branch requirement, branch-name format, entry cardinality, and change-mode selection. Conflict/failure semantics are the only notable omission.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description goes beyond the schema by prescribing the decision between `search`/`replace` and `patch` and by restating the numbered hunk and /dev/null header format, which reduces malformed patch submissions.

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?

States a specific verb and resource ("Create a commit") plus scope ("on an existing branch") and a non-obvious structural rule ("one change entry per file path"). It implicitly separates itself from create_branch by requiring a pre-existing branch, but no sibling is named explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit routing between the two change modes: search/replace for targeted edits, patch for additions, deletions, or multi-hunk diffs. That is strong when-to-use guidance, but it says nothing about when to use this tool versus siblings such as create_branch or create_pull_request.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.