in foundry agent i am getting error in foundry agent response can you help me to fixed it

Raghav Mittal 20 Reputation points
2026-07-15T13:16:22.8433333+00:00

Error code: 400 - {'error': {'message': 'No tool output found for function call cx.', 'type': 'invalid_request_error', 'param': 'input', 'code': None} actually I am creating a sharepoint with two tools 1. functions_Calling 2. file search tool. when I asked follow-up query to same agent i am getting error . i tried with this response =openai_client.responses.create(previous_response_id=previous_response_id, input=query, model=model)

Foundry Agent Service
Foundry Agent Service

A fully managed platform in Microsoft Foundry for hosting, scaling, and securing AI agents built with any supported framework or model


2 answers

Sort by: Newest
  1. Karnam Venkata Rajeswari 5,255 Reputation points Microsoft External Staff Moderator
    2026-08-04T18:53:10.6266667+00:00

    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:

    1. User submits a request.
    2. Agent determines that a custom function needs to be called.
    3. Agent returns a function_call request (for example, function name cx).
    4. Application receives the function call.
    5. Application executes the corresponding function.
    6. Application sends the result back using function_call_output with the same call_id.
    7. Agent generates the final response.
    8. 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-

    1. 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.

    1. 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.
    1. 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.

    1. 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

    Was this answer helpful?

    0 comments No comments

  2. Jose Benjamin Solis Nolasco 12,036 Reputation points Volunteer Moderator
    2026-07-15T13:40:27.98+00:00

    Welcome to Microsoft Q&A

    Hello @Raghav Mittal I hope you are doing well.

    The error:

    400 - No tool output found for function call cx.

    typically indicates that the model is attempting to continue a previous conversation where it expects the output of a tool call, but that output was never provided back to the Responses API.

    When using:

    response = openai_client.responses.create(

    previous_response_id=previous_response_id,
    
    input=query,
    
    model=model
    

    )

    
    

    the previous_response_id must reference a completed response. If the previous response contained a function call (such as your SharePoint function or File Search tool), you must first execute the tool and then submit its result back to the Responses API before sending the follow-up message.

    A few things to verify:

    • Check whether the previous response contains a function_call or tool_call.
    • Ensure your application executes the requested tool and sends the corresponding function_call_output back to the Responses API.
    • Only use previous_response_id after all pending tool calls have been completed successfully.
    • If you're combining Function Calling and the File Search tool, verify that each tool invocation returns an output before continuing the conversation.

    If the tool output is omitted, the next call will fail with an error similar to:

    No tool output found for function call...

    References

    If my answer helped you, please consider marking it as accepted. This helps others in the community find similar solutions.ccepted. This helps others in the community find similar solutions.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.