Skip to main content
Glama

Batch apply merge request suggestions

batch_apply_merge_request_suggestions

Apply multiple GitLab merge request code suggestions in one commit with preflight checks for validity and head SHA match, rejecting the batch if any suggestion fails validation.

Instructions

Apply multiple GitLab code suggestions in a single commit using the batch Suggestions API at PUT /suggestions/batch_apply. Performs preflight validation on every suggestion before any mutation: confirms each belongs to the specified project/MR, is still applicable, has not already been applied, and that the MR head SHA matches the caller's expected value. If any suggestion is invalid the entire batch is rejected before calling GitLab's batch-apply endpoint. Returns an array of suggestion states. An explicit acknowledgement is required. Note: GitLab's batch-apply endpoint does not accept an expected-head parameter, so a TOCTOU race is possible between preflight and mutation; the server remains authoritative at mutation time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsYesSuggestion IDs to apply in a single batch (1–50 suggestions).
projectYesGitLab project ID or full path such as group/project.
acknowledgeYesMust be true to confirm the suggestions should be applied.
commit_messageNo
expected_head_shaYesThe MR head SHA the caller last reviewed. The tool rejects the batch if the current MR head differs.
merge_request_iidYesProject-scoped internal ID.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYesGitLab response normalized for model use.
Behavior5/5

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

Annotations only indicate non-read-only and non-destructive. The description adds substantial behavioral context: batch validation, rejection semantics, required acknowledgement, and the TOCTOU race with server authority. It exceeds what structured data provides without contradiction.

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 ~100 words, front-loaded with the primary action, then logically flows through preflight validation, return value, and a critical caveat. No redundant sentences; every sentence adds value.

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

Completeness5/5

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

For a tool with high complexity (batch, validation, race condition), the description covers all necessary context: purpose, validation logic, return type, required acknowledgement, and a warning about a TOCTOU race. An output schema exists, so return details are not needed, making this complete.

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

Parameters5/5

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

Schema coverage is 83%, but the description enriches parameter meaning: it explains that expected_head_sha is essential for preflight consistency check, acknowledge is explicit confirmation, and ids are validated per-batch. It also explains why parameters like project and merge_request_iid are used together, surpassing schema descriptions.

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 description clearly states the action ('Apply multiple GitLab code suggestions in a single commit') and specifies the exact API endpoint. It differentiates from the sibling apply_merge_request_suggestion via 'multiple' vs singular, leaving no ambiguity about scope.

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?

It implicitly signals when to use this tool (batch application) and describes preflight validation, but it does not explicitly name the alternative singular tool or state 'use this instead of X when...'. The sibling names are self-explanatory, and the batch context is baked into the description, so the guidance is clear yet not fully explicit.

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/CobolJunkie/gitlab-mcp'

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