Building and customizing solutions using Microsoft 365 Copilot APIs and tools
The error "No tool output found for remote function call" when using the agent through Teams/Copilot indicates that the agent is invoking a tool (for example, Azure AI Search or a function tool), but the tool output is never returned back to the model in the follow‑up call.
In the Foundry Playground this is handled automatically, but when the agent is exposed via Bot/Teams, the tool execution and the follow‑up responses.create call must complete correctly and within the run limits.
Key points from the documented behavior:
- Tool output must be returned to the model
- When the agent returns a function/tool call, the application must:
- Execute the tool (for example, call Azure AI Search).
- Call
responses.createagain with:- The tool output in the
tool_outputspayload. - The
previous_response_idset to the ID of the response that contained the tool call.
- The tool output in the
- If this second call is missing or malformed, the system reports that no tool output was found.
- When the agent returns a function/tool call, the application must:
- Run expiration and latency
- Tool outputs must be returned before the run expires (10‑minute limit).
- If the tool call or any downstream call (for example, to Azure AI Search) takes too long, the run expires and the tool output is rejected, which can surface as a missing tool output error.
- For long‑running operations, the recommended pattern is to return a status and poll separately rather than blocking the run.
- Tool definition and JSON schema
- If the tool schema is misaligned between the agent definition and the code that executes it, arguments may fail validation or parsing.
- Invalid or unparsable arguments must be handled gracefully in the app; otherwise, the tool execution may never return a valid output to the model.
- Ensure:
- The function/tool is actually included in the agent definition.
- Parameter schema types and required fields match what the code expects.
-
requiredproperties are set andstrict: trueis used when stricter validation is needed.
- Teams/Copilot vs Playground behavior
- The Foundry portal/Playground can show agents and simulate tool behavior, but the portal itself does not execute function calls. For production flows (such as via Bot Service and Teams), function calling must be tested and validated via SDK or REST.
- If the Teams/Bot integration is wired to an older or incorrect endpoint, or if the code that handles tool calls was not updated after the Foundry endpoint format change, the second
responses.createcall with tool output may not be happening, leading to the "No tool output found" error.
- Recommended checks for this scenario
- Verify that the Bot/Teams integration is calling the current Foundry activity endpoint and that the code path handling tool calls is still invoked after the endpoint change.
- Add logging around:
- The response that contains the tool call.
- The execution of the tool (Azure AI Search call).
- The follow‑up
responses.createcall, includingprevious_response_idandtool_outputs.
- Confirm that the time between the tool call and the follow‑up
responses.createis well under 10 minutes. - Validate the tool schema and arguments to ensure they are valid JSON and match the defined schema.
If any of these steps fail (no follow‑up responses.create, expired run, or invalid tool output), the Teams/Copilot channel will surface an error indicating that no tool output was found for the remote function call.
References:
- Use function calling with Microsoft Foundry agents (python)
- Use function calling with Microsoft Foundry agents (csharp)
- Use function calling with Microsoft Foundry agents (typescript)
- Use function calling with Microsoft Foundry agents (java)
- Tool best practices for Microsoft Foundry Agent Service
- Publish agents to Microsoft 365 Copilot and Microsoft Teams
- Azure Language tools and agents
- Migrate to the new agents developer experience
- Microsoft Foundry publish to Teams Bot service error - Microsoft Q&A