[Fireworks AI docs]: pass a tools array with function definitions in the chat completions request, exactly like the OpenAI API. The model returns a tool call with a name and JSON arguments: execute the function in your code, then send the result back as a tool message. If the model never calls the function, make the description more explicit about when to use it and give one example. Validate the arguments JSON parses before executing.

Context: Fireworks AI speaks the OpenAI chat format, so function calling works the same way.