Skip to content

Commit d558bf4

Browse files
committed
feat(tools): add CSV tools with DuckDB SQL support
Add comprehensive CSV manipulation tools: - csv_read: Read CSV with pagination (limit/offset) - csv_write: Create new CSV files - csv_append: Append rows to existing CSV - csv_info: Get CSV metadata (columns, row count, file size) - csv_sql: Query CSV using SQL (powered by DuckDB) Features: - Session sandbox security (workspace_id, agent_id, session_id) - DuckDB as optional dependency for SQL queries - Security: Only SELECT queries allowed, dangerous keywords blocked - Full Unicode support - 45 tests covering all tools Install SQL support: pip install tools[sql]
1 parent cdbcac6 commit d558bf4

5 files changed

Lines changed: 1192 additions & 0 deletions

File tree

tools/pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ ocr = [
4242
"pytesseract>=0.3.10",
4343
"pillow>=10.0.0",
4444
]
45+
sql = [
46+
"duckdb>=1.0.0",
47+
]
4548
all = [
4649
"RestrictedPython>=7.0",
4750
"pytesseract>=0.3.10",
4851
"pillow>=10.0.0",
52+
"duckdb>=1.0.0",
4953
]
5054

5155
[build-system]

tools/src/aden_tools/tools/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from .file_system_toolkits.apply_patch import register_tools as register_apply_patch
3333
from .file_system_toolkits.grep_search import register_tools as register_grep_search
3434
from .file_system_toolkits.execute_command_tool import register_tools as register_execute_command
35+
from .csv_tool import register_tools as register_csv
3536

3637

3738
def register_all_tools(
@@ -67,6 +68,7 @@ def register_all_tools(
6768
register_apply_patch(mcp)
6869
register_grep_search(mcp)
6970
register_execute_command(mcp)
71+
register_csv(mcp)
7072

7173
return [
7274
"example_tool",
@@ -81,6 +83,11 @@ def register_all_tools(
8183
"apply_patch",
8284
"grep_search",
8385
"execute_command_tool",
86+
"csv_read",
87+
"csv_write",
88+
"csv_append",
89+
"csv_info",
90+
"csv_sql",
8491
]
8592

8693

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""CSV Tool package."""
2+
from .csv_tool import register_tools
3+
4+
__all__ = ["register_tools"]

0 commit comments

Comments
 (0)