Skip to main content
Glama

Bytebase: run SQL query

bytebase_query

Execute read-only SQL queries through Bytebase's SQL Editor, returning JSON rows while enforcing access policies, data masking, and audit logging.

Instructions

Execute SQL through the Bytebase SQL Editor and return rows as JSON. Read-only: only SELECT/WITH/SHOW/DESCRIBE/EXPLAIN are accepted. Queries run under the configured Bytebase identity and are subject to its access policies, data masking and audit log.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax rows (default 200).
databaseYesDatabase reference, e.g. "prod/aurora-prod/salla".
statementYesA single SQL statement.
dataSourceNoWhich data source to use. Defaults to the read-only replica when the instance has one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively states the tool is read-only, enforces a whitelist of SQL keywords, and explicitly mentions data masking and audit logging. This goes beyond a generic 'runs a query' and is essential for an agent to predict side effects. The only minor gap is not detailing error handling or rate limits, but the key behavior is well-covered.

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?

The description is three sentences with zero waste. The first sentence states purpose and output format, the second immediately states the read-only constraint (critical safety), and the third covers identity and policies. It is front-loaded with the most important operational detail (read-only), making it highly efficient.

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?

Given the tool's moderate complexity (4 params, 2 required, one enum) and no output schema, the description covers the essentials: purpose, safety constraints, and execution context. It omits details like error responses or pagination beyond the limit parameter, but the schema covers most parameter specifics. The read-only guarantee is the most critical missing piece that would otherwise require external knowledge, and it is present, so it is complete enough for safe invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already provides 100% coverage for all parameters, including examples and defaults, so the baseline is 3. The description adds value by clarifying what 'read-only' means for the statement parameter (restricting to specific SQL keywords), which is not in the schema. For dataSource, it offers a default behavior (read-only replica), complementing the enum. Thus, it exceeds the baseline.

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 description states a specific verb+resource ('Execute SQL through the Bytebase SQL Editor') and immediately distinguishes itself from sibling tools like bytebase_query_history and bytebase_describe_table by focusing on executing queries. It also clarifies the read-only nature, which is not evident from the tool name alone.

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 clearly states the read-only constraint (only SELECT/WITH/SHOW/DESCRIBE/EXPLAIN) and mentions execution under the configured identity, which implies permissions apply. However, it doesn't explicitly describe scenarios when to prefer this over siblings like bytebase_describe_table for schema exploration, or when to use the admin dataSource, leaving some inference to the agent.

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