GPT-5.2 fails to call tools properly

Hey,
We’ve recently switched to gpt-5.2 in our agent solution. During tests we observed that sometimes agent is not producing tool calls but includes tool input json as part of preamble message. Does anyone experienced similar issue?

You can see it on the trace screenshot below. Here is the schema of the tool:

{
“name”: “contact_agent”,
“description”: “Communicate with recipient (sub-agent) by sending a message.”,
“strict”: true,
“parameters”: {
“properties”: {
“recipient”: {
“description”: “The recipient of the message.”,
“title”: “Recipient”,
“type”: “string”
},
“content”: {
“description”: “The message to send to recipient.”,
“title”: “Content”,
“type”: “string”
}
},
“required”: [
“recipient”,
“content”
],
“title”: “contact_agent_args”,
“type”: “object”,
“additionalProperties”: false
}
}

In the Discourse software, you can enclose text in three backtick characters on their own lines:

```json
your copied code or string
```

And then receive a code fence presentation of the original text without alteration except for syntax highlighting:

{
  "name": "contact_agent",
  "description": "Communicate with recipient (sub-agent) by sending a message.",
  "strict": true,
  "parameters": {
    "properties": {
      "recipient": {
        "description": "The recipient of the message.",
        "title": "Recipient",
        "type": "string"
      },
      "content": {
        "description": "The message to send to recipient.",
        "title": "Content",
        "type": "string"
      }
    },
    "required": [
      "recipient",
      "content"
    ],
    "title": "contact_agent_args",
    "type": "object",
    "additionalProperties": false
  }
}

The suggestion I would have is that in a developer-provided function, you avoid the use of “recipient”, as that is already an internal name. Then that the function be wholly described within in description fields, saying what it will do and what it is good for, when it shall be called, and what action will result and what will be returned. This one tells the AI nothing.

Then eliminate field like “title” that do not match the tool name itself.

Also, do not refer to “preamble” in any prompting. In your main tool description field, if you want announcement first, simply indicate, “the user must be informed of your intention to invoke this function tool method before you then automatically send to it in the same response”.

See if the AI model calls tools properly when they describe their usefulness fully in a self-contained manner that is not otherwise referred to in prompting.

Hey @_j
The recipient is string alias of agent that should be contacted - the supervisor have list of allowed agents + their descriptions in the prompt.

This issue is not about this specific tool (I’ve just used it as example). The issue is that the agent didn’t generate a tool call, but instead it included tool call input in intermediate message that is being generated between tool calls. This issue is not present in gpt-5.1, therefore I ‘m wondering if anyone else experienced similar case and if this is something acknowledged.

1 Like