Agents SDK for TypeScript: Unsupported built-in tool call typ

Hi, I’m currently testing the new Agents SDK for TypeScript. I’ve defined an agent that’s specialized in answering questions about a specific website, using the webSearchTool():

const webAgent = new Agent({
  name: 'Web Agent',
  instructions: `
    You respond exclusively to questions about the portal: https://hostname/
  `.trim(),
  tools: [webSearchTool()]
});

The issue I’m facing is that the tool intermittently causes an exception when invoked.

I know it’s not a constant failure, because I can see successful uses in the OpenAI dashboard, where the agent performs a web search and produces a valid response:

Output:
Web Search  
Searched the Web

Assistant:  
[Answer]

However, when it fails, the trace shows:

Could not fetch Response  
Unsupported built-in tool call type

:puzzle_piece: Question

  • Is this a known limitation or a bug on the API side?
  • Or am I doing something wrong in the agent setup?

Thanks in advance!


Hi again,

After testing with debug logging enabled (DEBUG=openai-agents:*), I can confirm that the agent does invoke web_search_tool() correctly and receives valid results back from the model, including structured web_search_call and annotated citations.

However, immediately after a successful call, the SDK throws:

UserError: Unsupported built-in tool call type: {"type":"hosted_tool_call","name":"web_search_call",...}

This strongly suggests that:

:white_check_mark: The tool is available and used by the model
:cross_mark: But the SDK (@openai/agents) doesn’t yet know how to handle hosted tool results like web_search_call


:puzzle_piece: Summary of findings

  • tool_choice: "auto" is respected
  • The tool is invoked (web_search_call)
  • The model generates a valid, structured response
  • The SDK fails when trying to interpret the tool’s result

:white_check_mark: Temporary workaround

For now, I’m treating webSearchTool() as a behavioral guide: the model behaves more responsibly (“I can only answer about X”) even if I catch the error afterward. If the tool isn’t declared, the model tends to hallucinate answers instead of deferring.

Still, this seems like an SDK-level gap that should be addressed.

Thanks in advance for any clarification!

Have you tried downgrading your SDK to an earlier version? Curious if there’s a version where this bug doesn’t exist. (I’m having the same issue with 0.0.9)

This bug seems to exist in versions 0.0.5 through 0.0.9

0.0.1-0.0.4 seem to work

Thanks for the suggestion — I just tried downgrading to version @openai/agents@0.0.4, but unfortunately I’m still getting the same error:

UserError: Unsupported built-in tool call type: {"type":"hosted_tool_call","name":"web_search_call",...}

So it seems that even though earlier versions might have worked at some point, the current behavior of the backend (returning hosted_tool_call) is no longer compatible with any public SDK version — including 0.0.4.

Let me know if you manage to get it working on any version — or if you find a workaround that avoids this error. I’m still using webSearchTool() as a behavioral constraint, but catching the exception manually for now.

They released 0.0.10 today and it has a fix in it for this which worked for me

1 Like

Thanks for the information! I tried it with the latest version and it seems more stable. So far, I haven’t encountered the error again!