Tool Calling
When the LLM decides to use a tool (via MCP), the platform can either:
- Auto-execute the tool and feed results back to the LLM
- Request approval from the user before execution
Checking Pending Approvals
curl -X POST https://api.travila.ai/api/v1/llm/gateway/list-pending-approvals \
-H "X-API-Key: sk_your_key_here" \
-H "X-On-Behalf-Of: user_123" \
-H "Content-Type: application/json" \
-d '{
"conversation_key": "support-chat-001"
}'
Submitting Approvals
curl -X POST https://api.travila.ai/api/v1/llm/gateway/submit-tool-approvals \
-H "X-API-Key: sk_your_key_here" \
-H "X-On-Behalf-Of: user_123" \
-H "Content-Type: application/json" \
-d '{
"conversation_key": "support-chat-001",
"approvals": [
{
"tool_call_id": "call_abc123",
"approved": true
}
]
}'
Client-Side Tools
For tools that should execute on the client (e.g., UI actions), submit results back to the conversation:
curl -X POST https://api.travila.ai/api/v1/llm/gateway/submit-client-tool-results \
-H "X-API-Key: sk_your_key_here" \
-H "X-On-Behalf-Of: user_123" \
-H "Content-Type: application/json" \
-d '{
"conversation_key": "support-chat-001",
"results": [
{
"tool_call_id": "call_xyz789",
"result_json": "{\"status\": \"confirmed\"}"
}
]
}'
See the MCP Tools Guide for more on tool calling.