add_chart_to_dashboard
ChatGPTActivate a saved chart so it appears in the organization's active charts list. This makes the chart visible and queryable in embedded QueryPanel dashboards. The chart must already be saved (use save_chart first).
add_member
ChatGPTAdd or invite a member by email. Existing users join immediately; new users get an invite email and appear as pending until they accept.
annotate_schema
ChatGPTUpsert a human annotation on a schema target (table/column). target_identifier uses the schema-aware form e.g. database:db:schema:public:table:orders.
clear_ai_provider
ChatGPTRemove the organization's BYOK AI provider config.
create_dashboard
ChatGPTCreate a new dashboard in QueryPanel. Dashboards organize charts and data widgets. New dashboards start in 'draft' status.
create_datasource
ChatGPTCreate a datasource for this organization. For BigQuery OAuth connections, create the row then tell the user to finish Google OAuth in the admin UI.
create_key
ChatGPTUpload / register a signing key for the workspace. Provide PEM public_key and optionally private_key (stored in Vault). Prefer RSA. A default key is provisioned at org creation; use generate_key to mint a new pair when you need the private PEM returned once.
delete_chart
ChatGPTDelete a saved chart by ID.
delete_dashboard
ChatGPTDelete a dashboard by ID. This action cannot be undone.
delete_datasource
ChatGPTDelete a datasource by ID.
delete_key
ChatGPTDelete a workspace signing key.
delete_knowledge_chunk
ChatGPTDelete a gold_sql or glossary knowledge chunk by ID.
delete_schema_snapshot
ChatGPTRemove a synced schema snapshot and its table/column embeddings. Gold SQL and glossary chunks are typically preserved. Pass table_schema_id from list_schema_snapshots.
delete_session
ChatGPTDelete a query session and all its turn history by ID.
execute_sql
ChatGPTExecute SQL against the organization's datasource. Pass sql and params from generate_sql. Returns rows, fields, rowCount, and a resultId.
generate_key
ChatGPTGenerate an RSA-2048 keypair for this workspace, store the public key and Vault private key, and return the private PEM once so you can write QUERYPANEL_PRIVATE_KEY to the customer .env. Call when init_sdk needs a fresh key the integrator can copy, or when list_keys shows keys but the private PEM is unknown (existing keys are never re-exported). Prefer this over create_key unless the user already has PEMs to upload.
generate_sql
ChatGPTGenerate SQL for a natural-language question using schema chunks from search_schema. Pass context_chunks through unchanged from search_schema output. Returns sql, params, dialect, database, rationale, and queryId. Pass queryId to mark_query_executed after the SQL runs outside this tool.
get_ai_provider
ChatGPTGet the organization's BYOK AI provider status (OpenAI key configured or not).
get_chart
ChatGPTRetrieve a saved chart by ID, including its SQL, visualization spec, and live data.
get_dashboard
ChatGPTRetrieve a dashboard by ID, including its content and widget configuration.
get_datasource
ChatGPTGet a datasource by ID (secrets are never returned).
get_organization
ChatGPTGet organization details by ID.
get_session
ChatGPTRetrieve a query session by ID, optionally including its full turn history (each question asked and the SQL generated).
get_sql_quality
ChatGPTSQL quality rates for this workspace over the last 7 or 30 days. Returns outcome counts, fail rate, stuck drafts, gold-hit rate, latency percentiles, and pipeline mix.
init_sdk
ChatGPTBootstrap QueryPanel SDK for this workspace: workspace_id, readiness, env, paste-ready files. mode=headless → node-sdk qp.ask (zero-trust); mode=headful → createJwt + QuerypanelEmbedded; mode=both → both. If ensure_key and no active key, generates + Vault-saves a key and returns private_key once. Write response.files into the customer repo; never commit private keys.
list_audit_logs
ChatGPTList query audit sessions for the organization (NL→SQL history). For BlockNote dashboard editing use the admin UI; MCP dashboards use api chart/dashboard tools.
list_charts
ChatGPTList saved charts in QueryPanel, with optional filtering and pagination.
list_dashboard_charts
ChatGPTList all active charts for the organization, with pagination. Active charts are the charts currently visible in embedded dashboards.
list_dashboards
ChatGPTList dashboards in QueryPanel with optional status filtering and pagination.
list_datasources
ChatGPTList the datasources available to this organization. Returns each datasource name, type, and id. Use the id with search_schema, generate_sql, or execute_sql.
list_keys
ChatGPTList workspace signing keys (JWKS / public keys). Private key material is never returned — only private_key_secret_id may appear.
list_members
ChatGPTList members of the current organization (from OAuth org / x-organization-id).
list_organizations
ChatGPTList organizations (workspaces) the authenticated user belongs to.
list_schema_chunks
ChatGPTBrowse indexed schema chunks (table overviews, columns, gold SQL, glossary). Use filters to narrow results. For NL→SQL retrieval prefer search_schema instead.
list_schema_snapshots
ChatGPTList scanned schema snapshots (databases that have been synced). Each entry is a table_schemas / database snapshot with table counts.
list_schema_tables
ChatGPTList table names for a scanned database snapshot.
list_sessions
ChatGPTList query sessions (conversation history). Each session contains a series of natural language questions and the SQL generated for them.
mark_query_executed
ChatGPTMark a generated query EXECUTED after its SQL has run. Pass the query id from generate_sql. A query that already shipped a chart stays SUCCESS.
remove_chart_from_dashboard
ChatGPTDeactivate a chart by removing it from the active charts list. This hides the chart from embedded dashboards but does not delete the saved chart itself.
remove_member
ChatGPTRemove a member from the current organization.
save_chart
ChatGPTSave a chart to QueryPanel. Requires a title, SQL query, and a visualization spec (VizSpec from generate_visualization, or a Vega-Lite spec). Returns the saved chart with its ID.
search_schema
ChatGPTSearch the organization's indexed schema context for tables, columns, and example SQL relevant to a question. Returns ranked chunks plus the inferred primary table, database, dialect, and tenant settings. Call this FIRST, then pass its output through to generate_sql.
set_ai_provider
ChatGPTConfigure the organization's OpenAI API key (BYOK) and/or fallback-to-platform flag. Requires admin/owner role. Never echo the full key back.
set_dashboard_status
ChatGPTDeploy or undeploy a dashboard. Set status to 'deployed' to make it live, or 'draft' to take it offline.
sync_schema
ChatGPTSync / re-ingest schema for a datasource into the knowledge base (embeddings). Use force_reindex=true to rebuild even when the schema hash is unchanged.
test_ai_provider
ChatGPTValidate the org AI provider key (or a candidate api_key) against OpenAI.
test_datasource
ChatGPTTest connectivity for a datasource.
toggle_key
ChatGPTActivate or deactivate a workspace signing key.
train_glossary
ChatGPTTrain a business glossary term/definition into the knowledge base.
train_gold_sql
ChatGPTTrain the knowledge base with example gold SQL for a table/database. Improves NL→SQL quality for similar questions.
update_chart
ChatGPTUpdate a saved chart's title, description, SQL, or visualization spec.
update_dashboard
ChatGPTUpdate a dashboard's name, description, or content. content_json is a BlockNote JSON string for the dashboard layout.
update_datasource
ChatGPTUpdate a datasource. Omit fields you do not want to change. Password is write-only.
update_knowledge_chunk
ChatGPTUpdate a gold_sql or glossary knowledge chunk by ID. For glossary pass term+definition; for gold_sql pass sql (+ optional name/question/description).
update_member_role
ChatGPTUpdate a member's role in the current organization.
update_organization
ChatGPTRename the current or specified organization (requires access).