Built-in Tools

UseBelha agents can use built-in tools to search the web, execute code, read URLs, make API calls, and answer questions from documents.

Available Tools

Web Search

googleSearch

Search the web for current information.

Configuration

"googleSearch": { "enabled": true }

Example Prompt

"What are the latest developments this week?"

Code Execution

codeExecution

Write and execute Python code in a secure sandbox.

Configuration

"codeExecution": { "enabled": true }

Example Prompt

"Calculate the first 20 prime numbers"

URL Reading

urlContext

Read and summarize web pages for research.

Configuration

"urlContext": { "enabled": true }

Example Prompt

"Summarize https://example.com/article"

HTTP Actions

httpActions

Build custom integrations with any REST API using URL templates and parameter substitution.

Configuration

"httpActions": [{ "name": "getWeather", "method": "GET", "url": "https://wttr.in/{{city}}" }]

Example Prompt

"What is the weather in Tokyo?"

File Search (RAG)

fileSearch

Answer questions from uploaded documents using retrieval-augmented generation (RAG).

Configuration

"fileSearch": { "enabled": true, "storeId": "fileSearchStores/xxx" }

Example Prompt

"What does our policy say about refunds?"

Tool Configuration

Tools are configured in the agent's tools object:

json
{
  "name": "My Agent",
  "systemPrompt": "You are a helpful assistant...",
  "tools": {
    "googleSearch": { "enabled": true },
    "codeExecution": { "enabled": true },
    "urlContext": { "enabled": true }
  }
}

HTTP Actions

HTTP Actions allow custom API integrations. Each action defines:

FieldDescription
nameFunction name the AI will call
descriptionWhat the function does (helps AI decide when to use it)
methodHTTP method (GET, POST, PUT, DELETE)
urlURL template with {{param}} placeholders
headersOptional headers object
bodyOptional body template for POST/PUT

Security

HTTP Actions have built-in security protections:

  • SSRF Protection - Blocks requests to localhost, private IPs, and cloud metadata endpoints
  • Timeout - 10-second timeout on all requests
  • Protocol Restriction - Only HTTP/HTTPS allowed

File Search (RAG)

File Search uses retrieval-augmented generation (RAG) to answer questions from uploaded documents.

  1. Upload documents via POST /api/knowledge
  2. Enable fileSearch on your agent with the storeId
  3. The AI will automatically search documents to answer questions

Supported formats: PDF, TXT, HTML, CSV, MD, JSON, XML

Adding Tools to an Agent

bash
# Add a tool
curl -X POST "https://dev.usebelha.com/api/agents?id=ag_xxx&action=addTool" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-key" \
  -d '{"toolType": "googleSearch", "config": {"enabled": true}}'

# Remove a tool
curl -X POST "https://dev.usebelha.com/api/agents?id=ag_xxx&action=removeTool" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-key" \
  -d '{"toolType": "googleSearch"}'