Skip to main content
Glama
Azure DevOps MCP Server
by billg118

create_commit

Create a commit on an existing Azure DevOps branch by applying file changes via search/replace pairs or unified diffs.

Instructions

Create a commit on an existing branch using file changes.

  • Provide plain branch names (no "refs/heads/").

  • ⚠️ Each file path may appear only once per commit request—combine all edits to a file into a single change entry.

  • Prefer multiple commits when you have sparse or unrelated edits; smaller focused commits keep review context clear.

🎯 RECOMMENDED: Use the SEARCH/REPLACE format (much easier, no line counting!).

Option 1: SEARCH/REPLACE format (EASIEST) Simply provide the exact text to find and replace:

{
  "changes": [{
    "path": "src/api/services/function-call.ts",
    "search": "return axios.post(apiUrl, payload, requestConfig);",
    "replace": "return axios.post(apiUrl, payload, requestConfig).then(r => { processResponse(r); return r; });"
  }]
}

The server fetches the file, performs the replacement, and generates the diff automatically. No line counting, no hunk headers, no context lines needed!

Option 2: UNIFIED DIFF format (Advanced) If you prefer full control, provide complete unified diffs:

  • Each patch MUST have complete hunk headers: @@ -oldStart,oldLines +newStart,newLines @@

  • CRITICAL: Every @@ marker MUST include line numbers. Do NOT use @@ without line ranges.

  • Include 3-5 context lines before and after changes.

  • For deletions: --- a/filepath and +++ /dev/null

  • For additions: --- /dev/null and +++ b/filepath

Example unified diff:

{
  "changes": [{
    "patch": "diff --git a/file.yaml b/file.yaml\n--- a/file.yaml\n+++ b/file.yaml\n@@ -4,7 +4,7 @@ spec:\n spec:\n   type: ClusterIP\n   ports:\n-    - port: 8080\n+    - port: 9090\n       targetPort: http\n"
  }]
}

Input Schema

NameRequiredDescriptionDefault
changesYesList of file changes as either unified git diffs OR search/replace pairs
projectIdNoThe ID or name of the project (Default: no default project)
branchNameYesThe branch to commit to (without "refs/heads/", e.g., "codex/test2-delete-main-py")
repositoryIdYesThe ID or name of the repository
commitMessageYesCommit message
organizationIdNoThe ID or name of the organization (Default: example-org)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.54

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and discloses important traits: the server fetches the file and generates the diff for search/replace, branch names must omit refs/heads/, and duplicate file paths are rejected. It does not cover permissions, failure modes, or what the successful response contains.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded and well organized, but it is long and duplicates much of the schema with two full JSON examples. Repeated emphasis such as “much easier” and “no line counting” makes it less concise than it could be.

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 mutation tool with no annotations and no output schema, the description covers the key input complexity: two change formats, required branch naming, and commit-splitting guidance. It still lacks error conditions and return-value information, but is largely sufficient for correct invocation.

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 repositoryId, branchName, commitMessage, and both change formats in detail. The description reinforces the preferred search/replace option and the branch-name rule, but mostly restates what the schema provides.

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

Purpose5/5

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

The first sentence states a specific verb and resource: create a commit on an existing branch using file changes. It clearly distinguishes this from siblings such as create_branch or create_pull_request by focusing on adding changes to an existing branch.

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?

The description gives useful usage constraints: plain branch names, each file path only once per commit, and preferring multiple commits for sparse edits. It does not explicitly name when to use this instead of create_branch or create_pull_request, so it falls short of full alternative routing.

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