Skip to main content
Glama
Bytebase MCP

Bytebase MCP

Official

get_gitops_workflow

Generates GitOps workflow files that add a Bytebase SQL review to pull requests changing migrations and deploy on merge. Reads only; changes nothing in Bytebase.

Instructions

Return the workflow files that set up GitOps for a project. With them in the repository, every pull request that changes the migration folder gets a Bytebase SQL review, and merging it deploys. The tool reads only; it changes nothing in Bytebase.

Parameter

Required

Description

project

Yes

The project ID, e.g. "hr"

targets

Yes

One database group ("projects/hr/databaseGroups/all"), or one or more databases by the name ListDatabases gives ("instances/prod/databases/hr")

workloadIdentity

Yes

The email of the workload identity the jobs sign in as

folder

No

The folder that holds the migration files. Default "migrations"

To set up GitOps from the team's repository:

  1. Read the repository. The git remote gives the provider (GitHub or GitLab), the owner and the repository. Look for the folder that holds the SQL migration files.

  2. Ask the owner which databases to deploy to. List the project's database groups and databases with call_api (DatabaseGroupService/ListDatabaseGroups, DatabaseService/ListDatabases). Offer a group first: a database that joins it later is deployed with no change to the files, when its environment is one the files already deploy to.

  3. Find the workload identity with call_api WorkloadIdentityService/ListWorkloadIdentities on the project. Use one whose subject pattern names this repository. If there is none, create one with administer_workspace.

  4. Call this tool. Write each file at its path, and on GitLab add the include line the result gives to .gitlab-ci.yml. Ask before you replace a file that exists. Open a pull request into the default branch.

The jobs sign in with their own ID token, so the repository needs no secret. The workflows run only when a file in the migration folder changes, so the setup pull request runs neither, and the first pull request with a migration file is the test. With the GitOps Service Agent role, the identity's rollouts carry no issue, so no approval rule holds them: tell the owner that merging deploys.

You may fit the files to the repository, for example the runner, the stages, or how they join an existing pipeline. Keep BYTEBASE_URL, BYTEBASE_WORKLOAD_IDENTITY, the job permissions, the ID token settings, the action image, --project, --targets and the order of the deploy jobs. The identity admits every job in the repository, so the triggers alone decide which branch deploys: tell the owner before a change that lets another branch deploy.

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": {
      "project": "<project>",
      "targets": "<targets>",
      "workloadIdentity": "<workloadIdentity>"
    },
    "name": "get_gitops_workflow"
  }
}

Input Schema

NameRequiredDescriptionDefault
folderNo
projectYes
targetsYes
workloadIdentityYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so: it declares read-only semantics, explains that jobs authenticate with their own ID token so no repository secret is needed, that workflows fire only when the migration folder changes, and that with the GitOps Service Agent role merging deploys without approval. It even discloses a risk condition (the identity admits every job, so triggers alone decide which branch deploys).

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?

The purpose and read-only guarantee are front-loaded, and the numbered setup procedure keeps the long body navigable. It is long overall, and the closing guidance about preserving BYTEBASE_URL, job permissions, and deploy-job ordering is dense, but that detail is load-bearing for producing valid files rather than filler.

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 four-parameter tool with no output schema, the definition explains what is returned (files at paths, plus a GitLab include line), the full setup workflow around it, and operational caveats about branch triggers. Nothing an agent needs in order to call and act on the result appears missing.

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 description coverage is 0%, so the description must compensate, and it does with a full parameter table: meaning and example format for project ("hr"), two accepted forms for targets (database group path vs. instances/…/databases/…), the workload identity email, and the default value "migrations" for folder. This adds substantially more than the schema's bare type information.

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 opening sentence states a specific verb and resource ("Return the workflow files that set up GitOps for a project") and immediately bounds it with "The tool reads only; it changes nothing in Bytebase," which separates it from mutation siblings like administer_workspace and propose_database_change. An agent knows what this produces (CI workflow files) without opening the schema.

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?

It supplies an explicit ordered procedure (read repo, ask owner about targets, find workload identity via call_api WorkloadIdentityService/ListWorkloadIdentities, then call this tool) and names the alternative tools for the preparatory steps (call_api with ListDatabaseGroups/ListDatabases, administer_workspace for identity creation). It also gives an explicit guardrail: "Ask before you replace a file that exists."

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