A tool is anything an agent can invoke by name. Every tool AIDB knows about — built-in, custom, or imported from an MCP server — is listed in one place, aidb.tools:

SELECT name, tool_type, read_only FROM aidb.tools ORDER BY name;
Output
             name              | tool_type   | read_only
-------------------------------+-------------+-----------
 accept_relationship_candidates | native_tool | f
 add_comment_to_object          | native_tool | f
 add_relationship               | native_tool | f
 analyze_db_health              | native_tool | t
 ...

Tools can be invoked in three different ways:

  1. natively by the internal agents in AIDB.
  2. by external agents via MCP.
  3. through SQL for testing and development or other custom use cases.
SELECT aidb.run_tool('catalog_list_objects', '{"schema": "public", "object_type": "table"}');
Output
        run_tool
---------------------------------------------
[{"comment": null, "truncated": false, "object_name": "my_table", "object_type": "table", "schema_name": "public"},  ...

Tool calls are traced with OpenTelemetry when enabled, including the tool name, MCP server name and transport, and call count. See Observability for the full attribute list.

AIDB has three kinds of tools:

  • native_tool — AIDB's own built-in catalog. Always available; can't be added, removed, or reconfigured. See Native tools.
  • sql_tool — a parameterized SQL query you register yourself. See Custom SQL tools.
  • mcp_tool — a tool imported from an external MCP server. See MCP tools.

Give an agent access to a tool by listing its name in create_agent/update_agent's tools array.

Documentation map

PageWhat it covers
Native toolsAIDB's built-in tool catalog: ad hoc SQL, catalog discovery, semantic knowledge bases, models, volumes, embedding and document processing, agent management, pipelines
Custom SQL toolsaidb.create_sql_tool(), naming, parameter placeholders, read-only enforcement, removing tools
MCP toolsaidb.import_mcp_tools(), authentication, filtering, refreshing, removing servers, exposing AIDB's tools over MCP

For full parameter tables and return types, see Tools reference.