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
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:
The tool is available and used by the model
But the SDK (
@openai/agents
) doesn’t yet know how to handle hosted tool results likeweb_search_call
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
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!