Hello @Raghav Mittal ,
Welcome to Microsoft Q&A .Thank you for reaching out to us.
The Error code: 400 - No tool output found for function call cx indicates that a custom function call named cx was generated by the agent, but the corresponding function output was not available when the next conversation request was processed using previous_response_id.
In the Responses API function-calling workflow, every generated function call must have a matching function_call_output response associated with the same call_id before the conversation can continue.
Since the error specifically references function call cx, the current evidence points toward the function execution lifecycle rather than the SharePoint File Search capability itself. The SharePoint File Search configuration, connectivity, permissions, and service capacity are less likely to be the primary cause based on the available error details.
The expected function-calling workflow is:
- User submits a request.
- Agent determines that a custom function needs to be called.
- Agent returns a
function_call request (for example, function name cx).
- Application receives the function call.
- Application executes the corresponding function.
- Application sends the result back using
function_call_output with the same call_id.
- Agent generates the final response.
- The completed response ID can then be reused for follow-up requests.
The reported error typically occurs when the workflow stops after the function call is generated, the function output is not returned successfully, or a follow-up request is submitted before the previous response reaches a completed state.
Please check if the followign steps help-
- Validating the response state before submitting follow-up queries Before executing:
response = openai_client.responses.create(
previous_response_id=previous_response_id,
input=query,
model=model
)
capture the previous response details:
print(response.id)
print(response.status)
print(response.output)
Review whether the response contains:
type = function_call
name = cx
call_id = <value>
If a function call is present, confirm that the function execution cycle is completed before using the response ID for the next interaction.
- Verifying function output handling Confirm that the application performs the following steps:
- Detects the function call returned by the agent.
- Executes the function mapped to
cx.
- Captures the function execution result.
- Sends the result back using
function_call_output.
- Uses the same
call_id returned in the original function call.
- Waits for the completed agent response before storing
previous_response_id.
- Validate response ID handling
Ensure that previous_response_id references a completed response only.
Avoid storing or reusing a response ID when:
- A function call is still pending.
- Tool execution has not completed.
- The corresponding function_call_output has not been submitted.
The conversation can continue successfully only after all pending function calls have received their corresponding outputs.
- Validating response ID handling Ensure that previous_response_id references a completed response only. Avoid storing or reusing a response ID when:
- A function call is still pending.
- Tool execution has not completed.
- The corresponding function_call_output has not been submitted.
The conversation can continue successfully only after all pending function calls have received their corresponding outputs.
2.Reviewing Azure AI Foundry traces
Review the failed execution in Azure AI Foundry traces.
The expected execution sequence is:
Plain Text >User Input > Agent Decision>Function Call>Tool Execution>Function Output>Final Response
If the trace ends after the Function Call stage and does not show Function Output, the issue is confirmed within the function execution workflow.
3.Validate tool configuration
Since the agent contains both Function Calling and SharePoint File Search tools, ensure that each tool has a clearly defined purpose.
Please check if these steps help:
- Use descriptive function names instead of generic names such as cx.
- Provide clear function descriptions.
- Avoid overlapping responsibilities between custom functions and SharePoint File Search.
3.Performing isolation testing
The following tests can help confirm the affected component:
Test 1:
- Disable SharePoint File Search.
- Test the agent using only the cx function.
Test 2:
- Disable the cx function.
- Test the agent using only SharePoint File Search.
Test 3:
- Submit queries that do not invoke any tools.
- Validate whether follow-up conversations complete successfully.
These tests help determine whether the issue is isolated to custom function handling or another component.
As additional validation please also check-
RBAC and access permissions: Azure AI Foundry RBAC Documentation
Azure OpenAI troubleshooting:Azure OpenAI Troubleshooting Guide
Private networking configuration:Azure AI Foundry Private Link Configuration
The following references might be helpful , please check them out
Please let us know if the response was helpful
Thank you