Skip to main content
Glama

copilot_apply

Writes a finished job's reviewed staged edits to disk using its changeSetHash, refusing if any file changed and reporting exactly what was committed if a write fails midway.

Instructions

Write a finished job's staged edits to disk. Requires the changeSetHash from copilot_changes, so only reviewed content is applied. Refuses before writing anything if a file changed on disk since the job read it; prepares every file before committing and reports exactly what was written if a commit fails midway. Single use per job. Apply only within the user's authorized scope.

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": {
      "jobId": "<jobId>",
      "changeSetHash": "<changeSetHash>"
    },
    "name": "copilot_apply"
  }
}

Input Schema

NameRequiredDescriptionDefault
jobIdYes
changeSetHashYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses the staleness guard (refuses before writing if a file changed on disk), the prepare-then-commit staging model, partial-failure reporting, and single-use semantics. These are exactly the mutation risks an agent needs before invoking.

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?

Front-loaded with the action, then ordered as requirement, safety behavior, failure behavior, and constraints. Every sentence carries information, though the closing authorization line is somewhat boilerplate and could be merged.

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 no-annotation, no-output-schema mutation tool, the critical gaps are covered: preconditions, atomicity, failure reporting, and idempotency. It does not describe the success result shape beyond 'reports exactly what was written', nor where on disk the edits land, leaving minor residual uncertainty.

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 0%, so the description must compensate, and it only partly does: it explains changeSetHash's provenance and ties jobId implicitly to a 'finished job'. It adds no detail on hash format, where jobId comes from, or what makes a job eligible beyond 'finished'.

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?

States a precise verb and resource: 'Write a finished job's staged edits to disk.' The precondition ('finished job') plus the reference to copilot_changes as the source of changeSetHash clearly separates it from read-only siblings like copilot_changes or copilot_events.

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 a concrete workflow dependency: the changeSetHash must come from copilot_changes, so reviewed content is what gets applied. 'Single use per job' and the authorized-scope line further constrain use. It stops short of naming explicit when-not-to-use cases or alternatives for rejecting a change set (e.g. copilot_cancel).

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