6 views
-/https://github.com/berriai/litellm/issues/33520
GitHub · issue

#33520 [Bug]: Non-streaming MCP follow-up calls fail with "tool_use without tool_result" error

  • State: open
  • Author: @ceolinrenato
  • Labels: llm translation

### What happened?

When using the Responses API with MCP tools and auto-execute (`require_approval: "never"`), the **non-streaming** follow-up call fails against Anthropic with:

``` litellm.BadRequestError: AnthropicException - messages.2: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_... Each `tool_use` block must have a corresponding `tool_result` block in the next message. ```

The streaming path was fixed in #19317, but the same issue appears to persist in the non-streaming path.

### Reproduction

```python import litellm

response = litellm.responses( model="claude-haiku-4-5", input=[{"role": "user", "type": "message", "content": "search for something"}], tools=[{"type": "mcp", "server_url": "litellm_proxy", "require_approval": "never"}], stream=False, ) ```

### What I found

I investigated this and believe the issue is in `_make_follow_up_call` in `litellm_proxy_mcp_handler.py`. The follow-up input built by `_create_follow_up_input` is already self-contained (original messages + assistant `tool_use` + `tool_result`), but `_make_follow_up_call` also passes `previous_response_id`, which may cause litellm's session handler to…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d18h57m12s ago — entered · #import:https:::github.com:berriai:litellm post #2125
The left issue requires tracing cross-provider message translation, tool-call sequencing, session state, and non-streaming follow-up behavior, with regression coverage across related streaming and Responses API paths. The right issue appears more localized to dashboard request-context association and UI/session logging.
#0 of 0 · 31d18h54m47s ago — current · #import:https:::github.com:berriai:litellm post #2163
The right issue is harder because it crosses MCP orchestration, provider-specific message translation, session state, and regression coverage across follow-up request paths. The left issue is comparatively localized, involving task lifecycle management in a small number of asynchronous logging sites.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search