Skip to content

Is there a way to manipulate the response returned from an MCP tool call before passing the MCP response to the model? #2175

@Ali-Olliek

Description

@Ali-Olliek

Please read this first

  • Have you read the docs?Agents SDK docs
  • Yes
  • Have you searched for related issues? Others may have had similar requests
  • Yes

Question

Describe your question. Provide details if available.

After getting the response from an external MCP, and right before passing the response to the model, I want to manipulate the response and adjust it before passing it to the model.

So the scenario would be as follows:

  1. Submit a user query.
  2. Invoke the tool call.
  3. MCP tool invoked.
  4. MCP response returned.
  5. Adjust and manipulate the response. <-- I want to add this step.
  6. Pass the response to the model to complete the flow.

Any help would be much appreciated,

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions