Orq MCP is live: Use natural language to interrogate traces, spot regressions, and experiment your way to optimal AI configurations. Available in Claude Desktop, Claude Code, Cursor, and more. Start now →
LLMs can generate text, but they can’t check your database, call your APIs, or perform actions in your system. Function tools bridge that gap — you tell the model what functions exist, the model decides when it wants to call one and with what arguments, but your application is the one that actually executes the function. You then pass the result back to the model so it can formulate a natural language answer.Example use cases:
A customer asks “Is my order #12345 shipped?” → the model decides it needs order data and requests a call to get_order_status(order_id="12345"). Your backend queries the database, gets the tracking info, and sends it back. The model then replies “Yes, your order shipped on April 10 and is arriving Thursday.”
A user asks “What events are happening in Amsterdam today?” → the model requests get_local_events(city="Amsterdam"). Your app calls your events API, returns the list, and the model summarizes it conversationally.
An internal tool asks “How many open tickets are assigned to me?” → the model requests query_tickets(assignee="user-123", status="open"). Your service runs the query and passes back the count.
You send a request with tool definitions describing what functions your app can run. The model may decide it needs one — when it does, the response comes back with status: "requires_action" and the function name + arguments. The model doesn’t execute anything itself. Your application runs the function (a database query, an API call, any business logic), then sends the result back in a follow-up request. The model uses that result to generate the final answer.
Parse arguments from the function_call output item and run your function. In this example, the model called get_local_events with {"city": "Amsterdam"}.Your application calls whatever backend or API implements get_local_events and gets a result:
{"events": ["Kings Day Canal Parade", "Amsterdam Light Festival", "Rijksmuseum Late Night Opening"]}
The model may request additional tool calls after receiving results (e.g., it needs more data). Check the response status after each continuation — if it’s still requires_action, repeat step 2 and 3. Limit the number of rounds to prevent infinite loops.