blaschkeSign up
View Markdown

Function tools

Describe functions, inspect structured calls, execute only authorized actions in your application, and return matching results.

Own the complete loop.

The model proposes a call. Your application validates it and decides whether to execute it.

  • Send a function name, optional description and JSON parameters; omit the unsupported strict flag.
  • Read message.tool_calls and validate function names and arguments before acting.
  • Execute under your client's own permission policy.
  • Return the assistant tool-call message and a role: tool message with the same tool_call_id.
  • Bound model turns, outputs, concurrency and permissions.

Concrete call and result.

The complete custom-agent example uses this function with a three-file read allow-list.

JSON
{"model":"<model-id>","messages":[{"role":"user","content":"Read README.md and summarize the setup."}],"tools":[{"type":"function","function":{"name":"read_project_file","description":"Read an allow-listed public project file.","parameters":{"type":"object","properties":{"file":{"type":"string"}},"required":["file"],"additionalProperties":false}}}],"tool_choice":"auto","max_tokens":1024}
JSON
{"role":"tool","tool_call_id":"call_123","content":"# Blaschke ..."}

Protocol boundaries.

Valid request syntax does not guarantee reliable model selection or valid arguments.

Tool limits
ItemLimit
Definitions1–64
Calls per assistant history message8
Function name1–128 characters
Description16,384 characters
Encoded arguments32,768 characters
Tool choiceauto, none, required or named function