Whitepaper
Docs
Sign In
Tool
Tool
v0.0.1
DuckDB Access Agent2
Tool ID
duckdb_access_agent2
Creator
@geoheil
Downloads
33+
This tool provides access to a DuckDB database, with configurable database path.
Get
README
No README available
Tool Code
Show
""" title: DuckDB Access Agent description: This tool provides access to a DuckDB database, with configurable database path. version: 0.0.1 required_open_webui_version: 0.5.20 requirements: duckdb license: MIT """ import duckdb from pydantic import BaseModel, Field class Tools: class Valves(BaseModel): db_path: str = Field( default="/path/to/my.duckdb", description="The path to the DuckDB database file", ) def __init__(self): print("Initializing DuckDB tool class") self.citation = True self.valves = Tools.Valves() def _get_connection( self, ): # Changed from getconnection to _get_connection to match usage conn = duckdb.connect(self.valves.db_path, read_only=True) return conn def list_all_tables(self) -> list[str]: print(f"Listing all tables in {self.valves.db_path}") try: conn = self._get_connection() # Now matches the method name result = conn.execute( # "SELECT table_name, table_comment FROM information_schema.tables" "SELECT table_name FROM information_schema.tables" ) tables = [row[0] for row in result.fetchall()] # tables = result.fetchall() print(tables) return tables except Exception as e: return f"Error listing tables: {str(e)}"