Tool Management
Production - Tool registration, permissions, execution sandboxing, marketplace
The Tool Management system provides a registry for agent tools, manages execution permissions, enforces sandboxing, and offers a marketplace for discovering and installing tools. Defined in data-plane/ai-service/src/agents/tools.py and src/agents/tool_routes.py.
12.2.15.1Tool Registry
class ToolRegistry:
"""Central registry for agent tools."""
def register(self, name: str, handler: Callable, schema: dict, **kwargs):
"""Register a tool with its handler and JSON schema."""
...
def get_tool_definitions(self) -> list[dict]:
"""Get OpenAI-compatible tool definitions for LLM."""
...
async def execute_tool(self, tool_call: ToolCall, check_approval: bool = True) -> ToolResult:
"""Execute a tool call with optional approval check."""
...Built-in Tools
| Tool | Description | Requires Approval |
|---|---|---|
execute_sql | Execute SQL queries via Query Engine | Configurable |
create_chart | Generate chart specifications | No |
analyze_data | Statistical analysis on datasets | No |
search_docs | Search knowledge base | No |
export_data | Export data in various formats | No |
trigger_dag | Trigger Airflow DAGs | Yes |
deploy_model | Deploy ML models | Yes |
manage_config | Update platform configuration | Yes |
12.2.15.2Tool Marketplace
# List available tools
curl http://localhost:8000/api/v1/tools?tenant_id=acme-corp
# Get tool details
curl http://localhost:8000/api/v1/tools/{tool_name}?tenant_id=acme-corp
# Install a marketplace tool
curl -X POST http://localhost:8000/api/v1/tools/install \
-H "Content-Type: application/json" \
-H "X-Tenant-ID: acme-corp" \
-d '{"tool_name": "slack_notifier", "config": {"webhook_url": "..."}}'