Skip to main content

Available Tools

Tool Configuration

By default, both execute_sql and search_objects are enabled for each database source. You can customize which tools are available using [[tools]] entries in your dbhub.toml:

Default Behavior

If no [[tools]] entries are defined for a source, both execute_sql and search_objects are enabled by default:
Once a source has any [[tools]] entry, only the tools listed for it are enabled.

Selective Tool Exposure

Control which tools are exposed for each database source:
This is useful when you want to restrict AI models to read-only schema exploration without allowing SQL execution.

Per-Tool Settings

Configure built-in tools with specific settings like readonly and max_rows:
See Read-Only Mode for what readonly allows on each database, and the execute_sql documentation for max_rows.

Mixed Configuration

Different sources can have different tool configurations:

Custom Tools

You can also define custom tools alongside built-in tools:
This approach gives you fine-grained control: disable general SQL execution while providing specific, safe operations through custom tools.

Tool Naming

Tool names depend on how many sources DBHub is serving, not on the source ID: One source — a DSN (with or without --id), or a TOML file with a single [[sources]] entry:
Tool names: execute_sql, search_objects (no suffix) Two or more sources via TOML config — each source gets its own tools, suffixed with its ID:
Tool names: execute_sql_prod_pg and execute_sql_staging_mysql
Special characters in source IDs (hyphens, dots, etc.) are converted to underscores in tool names. For example, prod-pg becomes execute_sql_prod_pg.
Whatever the tool is called, execute_sql, explain_sql, health_check and custom tools report the source ID as source_id in their output.

Next Steps

Execute SQL

Execute SQL queries and statements on your database

Search Objects

Search and explore database schemas, tables, and objects

Explain SQL

Show a query’s execution plan without running it (opt-in)

Health Check

Report connection pool state and buffer cache hit ratio (opt-in)

Custom Tools

Create reusable parameterized SQL operations