get_schema
Inspect a Bytebase database schema to review tables, columns, and table details before writing queries or proposing changes. Use database, schema, or table filters to narrow results.
Instructions
Inspect a Bytebase database's schema.
Parameter | Required | Description |
database | Yes | Database name or substring (e.g., "employee_db" or "employee") |
instance | No | Workspace instance ID/name, or the full canonical name for a project instance |
project | No | Project name or ID to narrow resolution |
schema | No | Schema name for multi-schema engines (PG/MSSQL/Oracle/Snowflake/Redshift/CockroachDB/Databricks/Trino/Spanner/Hive); ignored with a note on MySQL/TiDB/etc. |
table | No | Drill into a single table; implies include="details" |
include | No | Detail level: "summary" (default), "columns", "details" |
Usage:
First call: get_schema(database="employee") → compact overview
Drill down: get_schema(database="employee", table="orders") → full table detail
Write a query: get_schema(database="employee", include="columns") → all tables with columns
Notes:
Metadata is auto-synced on access. The first call to a stale database may take longer.
For databases with many tables, columns/details modes return up to 200 tables PER SCHEMA. Use schema= or table= to narrow further.
Column masking metadata is only returned when table= is set.
rowCountEstimate is the row count the last metadata sync recorded. It can be an estimate, and can read 0 for a table that has rows; run a COUNT query when the number matters.
Requires bb.databases.getSchema permission.
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>"
},
"name": "get_schema"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | No | ||
| schema | No | ||
| include | No | ||
| project | No | ||
| database | Yes | ||
| instance | No |