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
| Name | Required | Description | Default |
|---|---|---|---|
| export | No | ||
| reason | Yes | ||
| schema | No | ||
| unmask | No | ||
| database | Yes | ||
| container | No | ||
| statement | Yes | ||
| durationHours | Yes |