MATIH Platform is in active MVP development. Documentation reflects current implementation status.
12. AI Service
Agent System
Tool Management

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

ToolDescriptionRequires Approval
execute_sqlExecute SQL queries via Query EngineConfigurable
create_chartGenerate chart specificationsNo
analyze_dataStatistical analysis on datasetsNo
search_docsSearch knowledge baseNo
export_dataExport data in various formatsNo
trigger_dagTrigger Airflow DAGsYes
deploy_modelDeploy ML modelsYes
manage_configUpdate platform configurationYes

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": "..."}}'