Overview

Tool Name

data_connector_tools

Purpose

The data_connector_tools provide comprehensive connectivity and management for relational data systems. Set up secure connections, explore schemas, run parameterized SQL with safe limits, and pull detailed table information for documentation, modeling, or pipelines.

Functions Available

  1. _query_database: Execute SQL on a chosen connection with limits, params, and optional Google Sheets export.
  2. _add_database_connection: Create or update a named connection with credentials, description, and access controls.
  3. _delete_database_connection: Remove a connection that is no longer required.
  4. _list_database_connections: List available connections with metadata for discovery and governance.
  5. _search_metadata: Search databases, schemas, tables, and columns to locate relevant objects quickly.
  6. _data_explorer: Browse objects by database and schema to refine scope and discover structures.
  7. _get_full_table_details: Return detailed schema info for a table including columns, types, and constraints.
  8. _run_sqlite_cli_commands: Run SQLite CLI commands for local prototyping and import or export tasks.

Key Features

Execute SQL

Run parameterized queries with row limits, overrides when required, and optional export to Google Sheets.

Manage Connections

Add, list, and delete named connections with access controls for specific data agents or all data agents.

Search Metadata

Find databases, schemas, tables, and columns with fast keyword search to cut down exploration time.

Table Insights

Retrieve full table definitions including types, keys, and constraints for modeling and documentation.

SQLite Passthrough

Use SQLite CLI commands for quick local workflows like importing CSVs or inspecting schemas.

Input Parameters for Each Function

_query_database

Parameters
NameDefinitionFormat
connection_idTarget connection identifier.String
querySQL text to execute. Optional if using note_id or note_name.String
database_nameDatabase name required by some engines such as Postgres.String
max_rowsMaximum rows to return. Default 20.Integer
max_rows_overrideIf true, bypasses default row limit. Use with caution.Boolean
paramsNamed parameters for parameterized queries.Object
note_idExecute a saved query by ID.String
note_nameExecute a saved query by name.String
export_to_google_sheetIf true, export results to Google Sheets.Boolean
export_titleTitle to use for the exported Google Sheet.String
Prefer parameterized SQL via params to improve safety and reuse, and set max_rows intentionally for large datasets.

2. _add_database_connection

Parameters
NameDefinitionFormat
connection_idUnique name for this connection.String
connection_stringSQLAlchemy compliant URI for the database engine.String
descriptionHuman readable description of purpose and scope.String
allowed_bot_idsData agents allowed to use this connection. Use "*" for all or provide explicit IDs.List

3. _delete_database_connection

Parameters
NameDefinitionFormat
connection_idConnection to remove from the registry.String

4. _list_database_connections

Parameters (No parameters. Returns all visible connections with metadata.)

5. _search_metadata

Parameters
NameDefinitionFormat
search_stringKeyword or pattern to search in metadata.String
connection_idRestrict search to a specific connection.String
databaseFilter to a database.String
schemaFilter to a schema.String
tableFilter to a table name.String
top_nMaximum number of results to return.Integer

6. _data_explorer

Parameters
NameDefinitionFormat
search_stringOptional partial match string for quick exploration.String
connection_idConnection context for exploration.String
databaseTarget database name. Not valid for SQLite.String
schemaTarget schema name. Not valid for SQLite.String
tableExact table name to locate.String
top_nMaximum number of results to return.Integer

7. _get_full_table_details

Parameters
NameDefinitionFormat
connection_idConnection where the table lives.String
databaseDatabase containing the table.String
schemaSchema containing the table.String
tableTable name for which to retrieve details.String

8. _run_sqlite_cli_commands

Parameters
NameDefinitionFormat
connection_idMust reference a SQLite connection.String
commandsCLI commands such as .tables or .schema .List
SQLite only
The CLI passthrough is limited to SQLite connections. Avoid destructive commands in shared environments.

Use Cases

  1. Cross database analytics Connect to Snowflake and Postgres, explore metadata, and run controlled SQL for KPIs with optional export to Google Sheets.
  2. Schema discovery Use _search_metadata and _data_explorer to identify the right tables and columns before writing joins.
  3. Data documentation Pull _get_full_table_details for core entities to build a lightweight data dictionary.
  4. Prototyping with SQLite Import CSVs and test SQL logic via _run_sqlite_cli_commands before promoting to a warehouse.
Start with metadata search to narrow scope, then fetch table details, then query. This lowers cost and reduces timeouts.

Workflow/How It Works

  1. Step 1: Add or verify a connection Create with _add_database_connection or list with _list_database_connections.
  2. Step 2: Explore and scope Use _search_metadata or _data_explorer to locate relevant objects.
  3. Step 3: Inspect details Call _get_full_table_details for types, keys, and constraints.
  4. Step 4: Run SQL safely Execute with _query_database, set max_rows, and prefer params for safety. Optionally export to Google Sheets.
  5. Step 5: Maintain hygiene Remove unused connections via _delete_database_connection and keep descriptions current.

Integration Relevance

  • Snowflake workflows: Use alongside snowflake_tools for staging and ingestion.
  • Harvesting: Feed harvester_tools to keep metadata fresh for search.
  • Collaboration: Export results with google_drive_tools and attach outputs via file_manager_tools.
  • Project tracking: Link queries and docs in project_manager_tools.
  • Versioning: Store reusable SQL with git_action.

Configuration Details

  • Provide valid SQLAlchemy URIs per engine and ensure network or VPN access is in place.
  • Use allowed_bot_ids for access control. "*" grants access to all data agents.
  • For engines that require it such as Postgres, provide database_name when querying.
  • Result pagination and row limits help protect memory usage on large datasets.
Ensure the executing identity has the required database permissions for both metadata and data access. Missing grants will cause search or query failures.

Limitations or Notes

  1. Row limits Default limit is 20 rows. Exactly 20 rows may indicate more data. Increase max_rows or paginate.
  2. Engine differences Some parameters and behaviors vary by engine. SQLite CLI passthrough is exclusive to SQLite.
  3. Performance and timeouts Long running queries can time out. Filter and aggregate early and avoid cross joins.
  4. Security Never include credentials in logs or outputs. Use parameterized queries to reduce injection risk.
  5. Exports Google Sheets export requires valid Drive credentials and permissions.

Output

  • Connection management Success or error messages when adding, deleting, or listing connections.
  • Query results Rows with columns, row count, execution metadata, and optional Google Sheets export info.
  • Metadata search Structured matches for databases, schemas, tables, and columns with relevance.
  • Table details Column definitions, data types, keys, and constraints.
  • SQLite CLI Raw command output and any error messages.