# I am confused about function (via. tools) in Responses API

**URL:** <https://community.openai.com/t/i-am-confused-about-function-via-tools-in-responses-api/1268630>\
**Category:** API\
**Tags:** responses, responses-api\
**Created:** [May 25, 2025, 7:56pm UTC](https://community.openai.com/t/i-am-confused-about-function-via-tools-in-responses-api/1268630 "2025-05-25T19:56:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![arda.arslan.a](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/arda.arslan.a/32/483350_2.png) [@arda.arslan.a](https://community.openai.com/u/arda.arslan.a)\
**Post date:** [May 25, 2025, 7:56pm UTC](https://community.openai.com/t/i-am-confused-about-function-via-tools-in-responses-api/1268630/1 "2025-05-25T19:56:59Z")

</div>

Hello,

I am currently trying to understand how to use Responses API and I am little confused function tool.

I can understand the concept of function in an AI assistant. Each function has a json\_schema definition for input parameter of the function, and when the model decides to use function(s) it can only call it with the specified parameters. I think AI can be more accurate when it uses parameters like this.

However, I don’t understand why it is important or what type of application it can be useful in. Can anyone has any detailed resources or examples?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![aprendendo.next](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/aprendendo.next/32/721758_2.png) [@aprendendo.next](https://community.openai.com/u/aprendendo.next)\
**Post date:** [May 25, 2025, 8:02pm UTC](https://community.openai.com/t/i-am-confused-about-function-via-tools-in-responses-api/1268630/2 "2025-05-25T20:02:28Z")

</div>

It allows the model to interact with external things.

Like send an email, get the current weather in the real world, or use your own search engine implementation to retrieve better context for its reasoning.

---

<div class="post-metadata">

**Author:** ![\_j](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_j/32/766292_2.png) [@\_j](https://community.openai.com/u/_j)\
**Post date:** [May 25, 2025, 8:14pm UTC](https://community.openai.com/t/i-am-confused-about-function-via-tools-in-responses-api/1268630/4 "2025-05-25T20:14:35Z")

</div>

> [@arda.arslan.a](#):
>
> I don’t understand why it is important

It allows the AI to _decide_. Is a function “search\_company\_knowledge” going to be useful for satisfying a user question?

The actual function is code that you write. The AI only produces its request for the function as a response.

You receive the function and it’s parameters, like the AI writing, `search_company_knowledge({"query":"price of dinglebops"})`. Then your code must satisfy that.

### A user need:

user: post a tweet “AI functions are neat”  
assistant: tweet\_tool({“user\_id”: “\_j”, “tweet\_contents”: “AI functions are neat!”})

### Then:

tool return: “success: tweet posted”  
assistant: _You should see your tweet that I sent for you now!_

> [@Tijn\_Sevens](#):
>
> You’re not just “talking to AI”—you’re giving it a toolkit

🧠 You’re not just posting an AI response and passing it off as a human writing, you’re showing how badly watermarked the AI output is with certain patterns.

---

<div class="post-metadata">

**Author:** ![arda.arslan.a](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/arda.arslan.a/32/483350_2.png) [@arda.arslan.a](https://community.openai.com/u/arda.arslan.a)\
**Post date:** [May 25, 2025, 8:34pm UTC](https://community.openai.com/t/i-am-confused-about-function-via-tools-in-responses-api/1268630/5 "2025-05-25T20:34:46Z")

</div>

Thank you for your answer. It is more clear now 🙂

Function tool is basically a decision layer for actual functions in my codebase, right? As we consider users’ massage is a plain text it is not possible to understand the question and taking necessary data from the massage with the traditional code logics. Function tool just tells us which function is necessary and provide input parameters along with the respond object.

> [@\_j](#):
>
> 🧠 You’re not just posting an AI response and passing it off as a human writing, you’re showing how badly watermarked the AI output is with certain patterns.

We live in times where it is hard to find genuine helpful human responses. 🙂

---

<div class="post-metadata">

**Author:** ![\_j](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_j/32/766292_2.png) [@\_j](https://community.openai.com/u/_j)\
**Post date:** [May 25, 2025, 8:53pm UTC](https://community.openai.com/t/i-am-confused-about-function-via-tools-in-responses-api/1268630/6 "2025-05-25T20:53:53Z")

</div>

> [@arda.arslan.a](#):
>
> Function tool just tells us which function is necessary

The function doesn’t do the work of deciding when it is necessary and useful: That is what the AI does.

- An AI model will typically respond to YOU the user.

- However, AI can instead respond to a function tool recipient when it starts producing an output.

You can experiment with functions in the Responses’ Prompts Playground. (Note that Chat Completions also has function-calling; it just doesn’t have internal tools developed by OpenAI such as “web search”)

Here I have a simple AI setup where I have created several tools that are constantly being offered to the AI (the specification is provided by an internal message):

 ![The image shows an interface for an AI assistant session named "Lots o functions," utilizing the "gpt-4.1" model with several integrated tools such as random integer, float, dice roll, fortune, fun facts, and OpenAI API search, and a system message indicating that the assistant is helpful and powered by OpenAI... (Captioned by AI)](https://us1.discourse-cdn.com/openai1/original/4X/7/d/9/7d91dd774d10e2ced89f911a98ee37cac0f6242d.png)

Let’s examine the structure of one of these:

```auto
{
  "name": "fortune",
  "description": "Returns a horoscope-like sentence randomly.",
  "strict": true,
  "parameters": {
    "type": "object",
    "required": [],
    "properties": {},
    "additionalProperties": false
  }
}

```

It is the most simple of functions. The AI doesn’t have to write any parameters. Calling the function merely acts as a trigger.

Now let’s talk to the AI, and see if it can intuit a good function to employ:

 ![The image shows a conversation where an assistant provides daily life advice, suggesting to start the day with intention and to stay hydrated. (Captioned by AI)](https://us1.discourse-cdn.com/openai1/original/4X/e/c/1/ec18e3e701e6f1a3059bff22d8781eb2202542de.png)

Didn’t call a function. I just get what the AI knew it can already answer about.

Let’s be more explicit in my desires:

 ![A user requests daily fortune-telling, and the assistant responds with a code snippet for a fortune function, prompting for a response to be entered or generated. (Captioned by AI)](https://us1.discourse-cdn.com/openai1/original/4X/4/0/6/40651b623acbf973aa2693443629f47f18a8b6b9.png)

The playground environment has called a function. You can see the empty JSON, but the API call would return the function name along with its arguments to be satisfied.

In the playground, “tab” just fills in some AI simulation. My real code might have a long list of predictions from a fortune file. The example functions are meant to be easily programmed.

 ![image](https://us1.discourse-cdn.com/openai1/original/4X/e/f/5/ef5d21165b81f51942565ed0f186ce769c375374.png)

How it is actually serviced: The developer’s code must call the API again, sending back the assistant’s request (and its ID), along with the return value, which can be natural language - it doesn’t have to be JSON. Then there might be more function calls, or a final response to a user, where the AI has the language generation ability to employ that new knowledge obtained:

 ![This image shows a fortune message stating, "You will find success in unexpected places today. Embrace new opportunities!" along with a friendly assistant's elaboration and encouragement to keep an open mind. (Captioned by AI)](https://us1.discourse-cdn.com/openai1/original/4X/1/7/f/17f33653923857650886d30ada1e87459d9db5da.png)

You can see the final response is also informed by the AI’s knowledge that it has fun facts also available as a function.

Here’s that playground preset, where you can talk to the AI, maybe as a D&D dungeon master who needs to find out if an attack was successful, or a programmer who needs a random seed value, and get an understanding of what your code can do to help the AI:

[https://platform.openai.com/playground/p/8inCYbuAVpAXIu8trnEktGY0?mode=chat](https://platform.openai.com/playground/p/8inCYbuAVpAXIu8trnEktGY0?mode=chat)

---

<div class="post-metadata">

**Author:** ![arda.arslan.a](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/arda.arslan.a/32/483350_2.png) [@arda.arslan.a](https://community.openai.com/u/arda.arslan.a)\
**Post date:** [May 25, 2025, 9:09pm UTC](https://community.openai.com/t/i-am-confused-about-function-via-tools-in-responses-api/1268630/7 "2025-05-25T21:09:52Z")

</div>

That is a fantastic answer, it is crystal clear now. If I have more question I will let you know. Thank you, cheers.
