Skip to main content
Glama
Bytebase MCP

Bytebase MCP

Official

request_access_grant

Request time-boxed, approver-gated permission to run one read-only database statement; optionally unmask or export results.

Instructions

Request an access grant: time-boxed permission to run one read-only statement on one Bytebase database, optionally with results unmasked or exported. A person approves the request in Bytebase before it takes effect.

Parameter

Required

Description

database

Yes

Full database name, as query_database prints it after "Database:", e.g. "projects/hr/instances/prod/databases/hr"

statement

Yes

One read-only statement; the grant applies to this exact statement

schema

No

Default schema for unqualified names; the rerun must pass the same one

container

No

CosmosDB container; the rerun must pass the same one

unmask

No

true to return masked columns unmasked

export

No

true to allow exporting the results

reason

Yes

Why the access is needed; the approver reads it

durationHours

Yes

Hours of access, counted from approval. The SQL Editor offers 1, 4, 24 and 168; the workspace maximum applies

The project must allow just-in-time access. Check allowJustInTimeAccess with call_api(operationId="ProjectService/GetProject") first; a missing field means off, and set_just_in_time_access turns it on.

Clients such as Claude Code ask the user to approve each call of this tool, so do not ask in chat first. Once the request is approved, rerun the statement unchanged with query_database, with the same schema and container; appliedAccessGrant in its result names the grant that applied. To use an export grant, pass the statement the same way to call_api(operationId="SQLService/Export"); query_database returns at most 1000 rows.

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": {
      "database": "<database>",
      "statement": "<statement>",
      "reason": "<reason>",
      "durationHours": "<durationHours>"
    },
    "name": "request_access_grant"
  }
}

Input Schema

NameRequiredDescriptionDefault
exportNo
reasonYes
schemaNo
unmaskNo
databaseYes
containerNo
statementYes
durationHoursYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior4/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 human approval gate, that duration counts from approval and is capped by workspace policy, that the statement must be submitted unchanged, and that query_database returns at most 1000 rows. Remaining gaps: it does not say what happens on denial, whether the grant permits repeated executions within the window or exactly one, or how expiry surfaces as an error.

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 a one-sentence definition, then an organized parameter table, then prerequisite and follow-up notes in priority order. Nothing is truly wasted, though the file-path-style example and the editor's duration presets are slightly more detail than an agent needs to invoke the tool correctly.

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?

There is no output schema, and the description compensates by telling the agent where to look afterward (appliedAccessGrant in query_database's result names the grant that applied) plus the 1000-row truncation caveat. For an 8-parameter, approval-gated tool with zero annotation coverage, this is complete enough to call correctly on the first try.

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 — a full parameter table covering all 8 fields, including the exact expected format for `database` (as printed after 'Database:' by query_database), the constraint that `schema` and `container` must be repeated identically on the rerun, and that `durationHours` is counted from approval subject to a workspace maximum. This adds real meaning well beyond the bare JSON types.

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 and resource — 'Request an access grant: time-boxed permission to run one read-only statement on one Bytebase database' — and immediately delimits scope (one statement, one database, read-only, optional unmask/export). This is clearly distinguishable from siblings like query_database (executes now) and grant_masking_exemption (different grant type).

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?

Gives explicit prerequisites (the project must allow just-in-time access; check via call_api with ProjectService/GetProject, and a missing field means off), names the remedy (set_just_in_time_access), and explicitly says NOT to ask in chat first because the client prompts on the tool call. It also routes to the post-approval alternative: rerun the unchanged statement with query_database, or for export use call_api with SQLService/Export.

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