MCP tool reference

The 24 tools an AI app sees after it connects, in the server's own words.

Every tool takes a connection: its id or its name, as list_connections returns them. Only connections whose AI level isn’t Off are listed. Hidden columns are left out of everything a tool returns.

Write tools follow the connection’s AI level: refused on Read-only, staged for your approval on Ask before write, run at once on Full. Destructive or unrecognised statements wait for approval at every level, with a backup first (BigQuery relies on its time travel instead). delete_rows counts as an ordinary write here: on Full it runs at once, and only BigQuery stages it. A staged change returns a change_id; follow it with the tools under Follow a change.

All tools

ToolKindWaits for approval
list_connectionsReadNo
list_schemasReadNo
list_tablesReadNo
describe_tableReadNo
get_ddlReadNo
search_schemaReadNo
search_valuesReadNo
sample_rowsReadNo
run_queryReadNo
explain_queryReadNo
estimate_query_costReadNo
execute_sqlWritePer level
insert_rowsWritePer level
update_rowsWritePer level
delete_rowsWritePer level
drop_objectDestructiveAlways
truncate_tableDestructiveAlways
wp_site_infoReadNo
wp_get_optionReadNo
wp_update_optionWritePer level
wp_search_replaceDestructivedry_run false
list_pending_changesReadNo
get_change_statusReadNo
wait_for_changeReadNo

Explore

list_connections

ReadList connections

Connections Gadwal lets you use, with each one's AI level (what you may do there).

No parameters.

list_schemas

ReadList schemas

Schemas in a connection.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.

list_tables

ReadList tables

Tables and views, optionally in one schema.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
schemastringSchema (default: public on Postgres, main on SQLite).

describe_table

ReadDescribe table

Columns (type, nullability, default, key, references), indexes, constraints and a row estimate. Columns hidden from AI are left out.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
table requiredstringTable or view name.
schemastringSchema (default: public on Postgres, main on SQLite).

get_ddl

ReadGet DDL

The CREATE statement for a table or view (hidden column names masked).

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
table requiredstringTable or view name.
schemastringSchema (default: public on Postgres, main on SQLite).

search_schema

ReadSearch schema

Tables and columns whose names contain the text.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
query requiredstringPart of a table or column name.

search_values

ReadSearch values

Find a value in every text column of every table in a schema (first 100,000 rows per table, up to 20 matches each).

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
text requiredstringThe value to find.
schemastringSchema (default: public on Postgres, main on SQLite).

Read data

Reads run one statement in a read-only transaction and stop after 30 seconds. Results are capped at the Rows returned to AI setting (200 by default), 2 KB per cell and 256 KB per answer.

sample_rows

ReadSample rows

Rows of a table (visible columns), optionally filtered by a WHERE condition.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
table requiredstringTable or view name.
limitintegerRows (default 20).
schemastringSchema (default: public on Postgres, main on SQLite).
wherestringOptional SQL condition, without the WHERE keyword.

run_query

ReadRun query

One read-only SQL statement (SELECT, WITH, VALUES, SHOW, EXPLAIN), run in a read-only transaction. Results are capped; for changes use execute_sql.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
sql requiredstringOne statement.

explain_query

ReadExplain query

The query plan of one statement (it is not run). On BigQuery: the dry run's estimate.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
sql requiredstringOne statement, without EXPLAIN.

estimate_query_cost

ReadEstimate query cost

BigQuery: the dry run's bytes processed and whether that is over the connection's cost limit (nothing runs or is billed). Other engines: the planner's plan, as explain_query.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
sql requiredstringOne statement, without EXPLAIN.

Change data

insert_rows, update_rows and delete_rows take structured values and address rows by primary key (up to 1,000 rows per call). Gadwal writes the SQL and shows it in Review. When it waits for approval, Gadwal checks each row again before it runs (except on BigQuery, where reading them would be a billed query): if one changed since the AI proposed the edit, nothing is applied. On Full, a write the AI runs itself gets 30 seconds, then it’s stopped and rolled back.

execute_sql

WritePer AI levelExecute SQL

One SQL statement that changes data or schema. Depending on the connection's AI level it runs at once, waits for the user's approval (you get a change id), or is refused. Destructive statements always wait for approval and get a backup first.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
sql requiredstringOne statement.

insert_rows

WritePer AI levelInsert rows

Insert rows (same rules as execute_sql).

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
rows requiredarray of objectsOne object per row: column → value (null for NULL).
table requiredstringTable or view name.
schemastringSchema (default: public on Postgres, main on SQLite).

update_rows

WritePer AI levelUpdate rows

Set column values on rows addressed by primary key (same rules as execute_sql).

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
keys requiredarray of objectsOne object per row: primary-key column → value.
table requiredstringTable or view name.
values requiredobjectColumn → new value for every addressed row.
schemastringSchema (default: public on Postgres, main on SQLite).

delete_rows

WritePer AI levelDelete rows

Delete rows addressed by primary key (same rules as execute_sql).

On Full, delete_rows runs at once; only BigQuery stages it.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
keys requiredarray of objectsOne object per row: primary-key column → value.
table requiredstringTable or view name.
schemastringSchema (default: public on Postgres, main on SQLite).

drop_object

WriteDestructiveAlways asks, backup firstDrop object

Drop a table or view. Always waits for the user's approval, with a backup first.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
table requiredstringTable or view name.
kindstringtable or view
schemastringSchema (default: public on Postgres, main on SQLite).

truncate_table

WriteDestructiveAlways asks, backup firstTruncate table

Remove every row. Always waits for the user's approval, with a backup first.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
table requiredstringTable or view name.
schemastringSchema (default: public on Postgres, main on SQLite).

WordPress

For MySQL and MariaDB connections that hold a WordPress install. See WordPress mode.

wp_site_info

ReadWordPress site info

The WordPress installs in a MySQL / MariaDB connection: table prefix, siteurl and home, WordPress version, active plugins and, for multisite, its blogs.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
schemastringDatabase (default: the connection's).

wp_get_option

ReadGet WordPress option

One option from <prefix>options. Serialized PHP is unserialized into value (JSON: lists as arrays, other arrays and objects as objects, objects with __class); raw is the stored text.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
name requiredstringOption name, e.g. siteurl or theme_mods_twentytwentyfive.
blogintegerMultisite: the blog id (default 1, the main site).
prefixstringTable prefix of the install (wp_ …), from wp_site_info; needed when the database holds several.
schemastringDatabase (default: the connection's).

wp_update_option

WritePer AI levelUpdate WordPress option

Change one existing option. Pass value as JSON: when the option is serialized it is re-serialized with correct byte lengths (keys keep their order); otherwise arrays and objects are serialized and scalars stored as text, as update_option() does. Or pass raw, the exact text. Same rules as update_rows, with a backup of the options table first. An option whose serialized data doesn't parse is refused unless force is true.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
name requiredstringOption name.
blogintegerMultisite: the blog id (default 1, the main site).
forcebooleanOverwrite a value whose serialized data doesn't parse.
prefixstringTable prefix of the install (wp_ …), from wp_site_info; needed when the database holds several.
rawstringThe exact text to store, instead of value.
schemastringDatabase (default: the connection's).
valueany JSONThe new value as JSON.

wp_search_replace

WriteDestructiveDry run; the change always asksWordPress search & replace

Serialized-aware search & replace over a WordPress install (domain moves, http → https). dry_run (default true) only counts, per table and column, with samples. dry_run false always waits for the user's approval, whatever the AI level; on approval each table is backed up, then changed in one transaction. Post GUIDs, tables without a key and tables that can't roll back (MyISAM) are skipped unless asked.

ParameterTypeDescription
connection requiredstringConnection id or name, from list_connections.
replace requiredstringReplacement text (may be empty).
search requiredstringText to find (case-sensitive unless case_insensitive).
all_tablesbooleanEvery table of the database, not just the install's prefix.
allow_non_transactionalbooleanAlso change MyISAM/Aria tables, which can't roll back.
case_insensitivebooleanMatch ASCII letters in any case.
dry_runbooleanDefault true: count only. false proposes the change for approval.
include_guidbooleanAlso change posts' guid (WordPress advises against it).
prefixstringTable prefix of the install (wp_ …), from wp_site_info; needed when the database holds several.
schemastringDatabase (default: the connection's).

Follow a change

An AI app only sees its own changes. See How AI review works for the statuses.

list_pending_changes

ReadList pending changes

Your changes that are waiting for the user, or were decided recently.

No parameters.

get_change_status

ReadGet change status

Where one of your changes stands: pending, approved, applied, rejected (with the user's reason), expired or failed.

ParameterTypeDescription
change_id requiredstringFrom execute_sql and the other write tools.

wait_for_change

ReadWait for change

Wait until the user decides on one of your changes (up to timeout_seconds, default 55, max 120).

ParameterTypeDescription
change_id requiredstringFrom execute_sql and the other write tools.
timeout_secondsintegerDefault 55, at most 120.

Resources and prompts

Clients that support MCP resources can read gadwal://<connection>/schema (tables and their visible columns) and gadwal://<connection>/table/<name> (one table, as describe_table). Two prompts are offered:

  • explore-database (connection): Look around a connection and explain what it holds.
  • write-migration (connection, goal): Propose a schema change as SQL for the user to review.