Tools and function calling

Run Site6 tools, use web search and connect functions that run in your application.

Server tools

Site6 executes built-in tools when they are included in tools. You can also call one directly with POST /v1/tools/execute.

Shell
curl --fail-with-body -sS https://site6.eokgg.win/v1/tools/execute \
  -H "Authorization: Bearer $SITE6_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"name":"calculator","arguments":{"expression":"17 * 3"}}'

Built-in tool catalogue

ToolUseArguments
web_searchFind public sources for a focused query.query (string), max_results (integer, optional)
fetch_urlRead text from a public HTTPS page.url (string)
calculatorEvaluate arithmetic with parentheses, powers, constants pi/e and common mathematical functions.expression (string)
timeGet the current date and time in an IANA time zone.timezone (string, optional)
clockGet the current date, day of the week and time. The default time zone is UTC.timezone (string, optional)
weatherGet current weather at latitude and longitude using Open-Meteo.latitude (number), longitude (number)
convert_unitsConvert length, mass, time, temperature, volume or speed units.value (number), from (string), to (string)
random_numberGenerate a random integer in an inclusive range.minimum (integer), maximum (integer)
generate_uuidGenerate a new UUID version 4.None
sha256Calculate the SHA-256 digest of UTF-8 text.text (string)

Call GET /v1/tools for the complete JSON schemas.

Use a built-in tool in chat

JSON
{
  "model": "deepseek-v4.1-flash-1017",
  "messages": [{"role": "user", "content": "Use the calculator to multiply 17 by 3."}],
  "tools": [{"type": "calculator"}],
  "tool_choice": "required",
  "max_tokens": 256
}

For a current fact, use {"type":"web_search"}. With automatic tool choice, a self-contained chat can skip search. Search tool results identify the sources and whether they came from upstream or Site6. Responses accepts a dedicated web search selector when the lookup is required.

Client functions

Declare a function as an object schema. Site6 returns a matching call for your application to execute.

JSON
{
  "model": "deepseek-v4.1-flash-1017",
  "messages": [{"role": "user", "content": "Find the shipping status for order DEMO-42."}],
  "tools": [{
    "type": "function",
    "function": {
      "name": "lookup_order",
      "description": "Read the status of a sample order.",
      "parameters": {
        "type": "object",
        "properties": {"order_id": {"type": "string"}},
        "required": ["order_id"],
        "additionalProperties": false
      }
    }
  }],
  "tool_choice": "auto"
}

Append the returned assistant message including tool_calls. Then append one tool message per call. The example below shows the two new messages after your original user message.

JSON
[
  {
    "role": "assistant",
    "content": null,
    "tool_calls": [{
      "id": "call_example",
      "type": "function",
      "function": {"name": "lookup_order", "arguments": "{\"order_id\":\"DEMO-42\"}"}
    }]
  },
  {
    "role": "tool",
    "tool_call_id": "call_example",
    "content": "{\"status\":\"Shipped\"}"
  }
]

Use the actual ID in the response. Resend the complete Chat message array, available tool definitions and any custom instructions. Responses continuations represent the same exchange with function_call_output.

Tool options and limits

tool_choice accepts auto, none, required or a named function. Set parallel_tool_calls: false for a single call. A request accepts up to 512 tool definitions and up to 32 parallel calls. Schema and argument sizes also count towards the request and context limits.

Site6 validates tool calls and reports the actual router in tool_router_model when relevant. If a server tool succeeded and the final generation failed, the error can include tool_results. Keep those results before retrying to avoid repeating completed actions.

Search the docs