Skip to main content
Glama
GitLab MCP Server

GitLab MCP Server

by ttpears

Custom REST Write

execute_rest_write
Destructive

Execute arbitrary POST, PUT, PATCH, or DELETE requests against GitLab REST API write endpoints not covered by dedicated tools; verify paths before destructive DELETE calls.

Instructions

Execute an arbitrary POST/PUT/PATCH/DELETE request against the GitLab REST API at /api/v4. Open-ended escape hatch for write endpoints not covered by a dedicated tool. Destructive — DELETE is permitted, so check the path before invoking. For reads, use execute_rest_read.

Input Schema

NameRequiredDescriptionDefault
bodyNoRequest body as a JSON value or JSON-encoded string. Sent as application/json; nested objects are preserved. Omit for endpoints that don't take a body (most DELETE / some PUT).
pathYesPath under /api/v4, beginning with "/" (e.g. "/projects/42/issues" or "/projects/foo%2Fbar/merge_requests/3/merge"). Must not include host, "/api/v4" prefix, or "?" query string.
queryNoQuery string parameters. Most write endpoints take their args in the body, but a few mix.
methodYesHTTP method. DELETE is destructive and not reversible.
userCredentialsNoYour GitLab credentials (optional — falls back to the configured env token if not provided)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv4.0.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / body / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": {},
      +    "propertyNames": {
      +      "type": "string"
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "items": {},
      +    "type": "array"
      +  },
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / body / description
      Previous value: -"Request body — JSON-serialized as application/json. Omit for endpoints that don't take a body (most DELETE / some PUT)."New value: +"Request body as a JSON value or JSON-encoded string. Sent as application/json; nested objects are preserved. Omit for endpoints that don't take a body (most DELETE / some PUT)."
    • addedInput schema / properties / query / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • changedInput schema / properties / userCredentials / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "accessToken": {
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "gitlabUrl": {
      -        "format": "uri",
      -        "type": "string"
      -      }
      -    },
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "accessToken": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "gitlabUrl": {
      +        "format": "uri",
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. Addedv1.19.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false and non-idempotent, so the safety profile is covered structurally; the description reinforces it with "DELETE is permitted, so check the path" which tells the agent how to mitigate. It does not cover remaining behavioral unknowns such as required token scopes/permissions, rate limiting, or what an error from the underlying endpoint looks like.

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?

Four short sentences, front-loaded with the operation and the destructive caveat, then the sibling routing, then nothing else. No restatement of the schema and no padding.

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?

With annotations covering safety, a fully documented 5-parameter schema, and no output schema, the description covers the decision-relevant information for a generic escape hatch. The one gap is that it never says what comes back (raw GitLab response body vs. wrapped) or how non-2xx responses are surfaced, which matters for an arbitrary-endpoint tool.

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% and the schema itself is unusually detailed (path must start with "/", no /api/v4 prefix or query string; body as JSON value or JSON-encoded string; credentials fall back to env token). The description adds no parameter-level meaning beyond that, so the baseline 3 applies.

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 specific verb (execute) and resource (arbitrary GitLab REST write request at /api/v4) with the allowed methods enumerated in the first sentence. It explicitly distinguishes itself as an escape hatch for endpoints not covered by dedicated tools, which separates it cleanly from the long list of specific write siblings like create_issue or update_merge_request.

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

Usage Guidelines5/5

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

"Open-ended escape hatch for write endpoints not covered by a dedicated tool" states the selection condition, and "For reads, use execute_rest_read" names the alternative and the boundary that routes to it. It also adds a pre-invocation check ("check the path before invoking") tied to the destructive path, which is actionable guidance rather than filler.

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