Tools work the way they do in the OpenAI and Anthropic SDKs. The model asks for a tool call, your code runs it, and you send the result back in the next request. Hollow never runs a tool for you.
Only models with Tool calling in the Models table can use tools. A request to any other model runs without them.
To try a tool without writing code, define it in the Playground under Parameters. The call appears in the conversation, you type the result, and sending it lets the model carry on.
Send the tool definitions with the request. A tool has a name, a description and a JSON Schema for its input.
curl 'https://models.projecthollow.com/v1/chat/completions' \
-H "Authorization: Bearer $HOLLOW_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "claude-haiku-5-5",
"messages": [
{
"role": "user",
"content": "What is the weather in Leeds?"
}
],
"max_tokens": 256,
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a city.",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string"
}
},
"required": [
"city"
]
}
}
}
]
}'curl 'https://models.projecthollow.com/v1/messages' \
-H "Authorization: Bearer $HOLLOW_API_KEY" \
-H 'anthropic-version: 2023-06-01' \
-H 'Content-Type: application/json' \
-d '{
"model": "claude-haiku-5-5",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "What is the weather in Leeds?"
}
],
"tools": [
{
"name": "get_weather",
"description": "Get the current weather for a city.",
"input_schema": {
"type": "object",
"properties": {
"city": {
"type": "string"
}
},
"required": [
"city"
]
}
}
]
}'The OpenAI-compatible endpoint also accepts the older functions list in place of tools.
- OpenAI-compatible:
finish_reasonistool_calls, andmessage.tool_callslists each call with anid, afunction.nameandfunction.arguments. The arguments are a JSON string: parse it. - Anthropic-compatible:
stop_reasonistool_use, andcontentholds atool_useblock for each call with anid, anameand aninputobject.
- Run the tool in your code.
- Add the model's reply to
messagesexactly as you received it. - Add the result, tied to the call by its id, and send the request again with the same
tools.
choice = response.choices[0]
if choice.finish_reason == "tool_calls":
call = choice.message.tool_calls[0]
arguments = json.loads(call.function.arguments) # {"city": "Leeds"}
result = get_weather(**arguments)
messages.append(choice.message)
messages.append({"role": "tool", "tool_call_id": call.id, "content": result})
final = client.chat.completions.create(model="claude-haiku-5-5", messages=messages, tools=tools)
print(final.choices[0].message.content)- OpenAI-compatible: the result is a message with the role
tooland thetool_call_idof the call. Its content is text. - Anthropic-compatible: the result is a
tool_resultblock in a user message with thetool_use_idof the call. Setis_errortotruewhen the tool failed. - A model can ask for several tools in one reply. Send one result for each.
Add "stream": true as for any request. Text arrives as it is written. A tool call arrives whole, not in pieces: the name and the complete arguments come together once the model has finished the call.
- OpenAI-compatible: one chunk carries the call in
delta.tool_calls, with the arguments complete. The last chunk hasfinish_reasonset totool_calls. - Anthropic-compatible: a
tool_usecontent block starts, oneinput_json_deltacarries the whole input, andmessage_deltaends withstop_reasonset totool_use.
The streaming parts of both SDKs read these events as they would any others. Build the call from the event, then send the result back as above.