Skip to main content
Glama
GitLab MCP Server

GitLab MCP Server

by ttpears

Custom GraphQL Query

execute_custom_query

Run custom GitLab GraphQL queries to filter issues by assignee, author, or labels when standard search returns no results. Paginate and limit query complexity to avoid timeouts.

Instructions

Execute custom GraphQL queries for complex filtering (e.g., issues with assigneeUsernames: ["user"], labelName: ["bug"]). Use this for structured filtering by assignee/author/labels when search tools return 0 results. Use pagination and limit complexity to avoid timeouts.

Input Schema

NameRequiredDescriptionDefault
queryYesGraphQL query string. Example: query { issues(assigneeUsernames: ["cdhanlon"], state: opened, first: 50) { nodes { iid title webUrl } } }
variablesNoVariables for the GraphQL query
requiresWriteNoHint that this needs write access. Mutations are auto-detected and always write-gated regardless of this flag.
userCredentialsNoYour GitLab credentials (optional — falls back to the configured env token if not provided)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv4.0.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • 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"
      +  }
      +]
    • addedInput schema / properties / variables / propertyNames
      Added value: +{
      +  "type": "string"
      +}
  2. Changed1 schema field changedv1.19.1
    • changedInput schema / properties / requiresWrite / description
      Previous value: -"Set to true if this is a mutation that requires write permissions"New value: +"Hint that this needs write access. Mutations are auto-detected and always write-gated regardless of this flag."
  3. Changed1 schema field changedv1.15.0
    • changedInput schema / properties / userCredentials / description
      Previous value: -"Your GitLab credentials (optional - uses shared token if not provided)"New value: +"Your GitLab credentials (optional — falls back to the configured env token if not provided)"
  4. First observedv1.7.3

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false and idempotentHint=false, so the agent knows this is not a safe repeatable read; the description adds genuine behavioral context about timeouts and pagination, which is not in the annotations. It does not disclose that arbitrary mutations can be issued, that mutations are write-gated, or anything about error/empty-result behavior, so it neither contradicts nor fully complements the annotation profile.

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?

Three short sentences, front-loaded with the purpose, then the usage trigger, then the performance caveat – no filler. The embedded example with bracket notation is slightly noisy but still illustrative rather than wasteful.

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

Completeness3/5

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

There is no output schema, so the description could have said something about return shape or error semantics for arbitrary GraphQL, and it omits any pointer to get_available_queries/get_type_fields for discovering valid query structure despite those siblings existing. With 4 parameters including a nested credentials object, the definition is workable but leaves real gaps for an agent composing a query blind.

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 baseline is 3; the schema already explains query, variables, requiresWrite, and userCredentials. The description's example adds a small amount of extra meaning (labelName filtering, which is absent from the schema example), but it says nothing about variables or credentials handling beyond what the schema already states.

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?

The description gives a specific verb and resource ("Execute custom GraphQL queries") plus a concrete example (issues filtered by assigneeUsernames/labelName), so an agent knows exactly what operation this performs. It does not distinguish itself from the low-level siblings execute_rest_read/execute_rest_write or explain how it relates to get_available_queries, so it falls short of full sibling differentiation.

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 states an explicit trigger – "Use this for structured filtering by assignee/author/labels when search tools return 0 results" – and adds a performance caveat about pagination and query complexity. However, it never names the specific search alternatives (search_issues, get_issues, search_gitlab) nor says when NOT to use raw GraphQL, leaving the routing decision partly to inference.

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