8 views
-/https://github.com/berriai/litellm/issues/31909
GitHub · issue

#31909 [Bug]: mcp_semantic_tool_filter strips ALL tools (N->0) for standard nested chat/completions tool format — _extract_tool_info only reads top-level name

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

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

With `litellm_settings.mcp_semantic_tool_filter.enabled: true`, any `/chat/completions` request whose `tools` array uses the **standard OpenAI nested format** — `{"type": "function", "function": {"name": ..., "description": ...}}` — gets **every tool silently stripped** before the request reaches the model. The proxy logs `Semantic tool filter: N->0 tools` and the response carries `x-litellm-semantic-filter: N->0`.

This is the format sent by common OpenAI-compatible clients (observed with Open WebUI, which re-sends the proxy's own MCP gateway tools in this shape), so in practice the filter breaks all tool calling for those clients. The model then answers "I don't have the ability to search the web..." despite the client having sent the tools.

### Root cause

`litellm/proxy/_experimental/mcp_server/semantic_tool_filter.py` → `SemanticMCPToolFilter._extract_tool_info()`:

```python if isinstance(tool, dict): # OpenAI function format name = tool.get("name", "") description = tool.get("description", name) ```

For the nested chat/comp…

GitHub resolver

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

Refresh page
vote history (4 events)
#0 of 0 · 31d19h8m24s ago — entered · #import:https:::github.com:berriai:litellm post #1829
The right issue requires a new provider integration spanning request translation, authentication, streaming/event parsing, tool and reasoning handling, configuration, routing, tests, and compatibility validation. The left issue is comparatively localized to correcting nested input extraction and adding focused regression coverage, with lower integration and operational risk.
Issue #26241 is harder because it crosses request translation, parameter-filtering semantics, configuration propagation, and compatibility testing across API paths. Issue #31909 is comparatively localized to nested input normalization and focused regression coverage.
The left issue requires changes to shared exception classification semantics, careful compatibility handling across providers and retry behavior, plus broader regression coverage. The right issue is a localized parsing correction with comparatively contained testing and lower integration risk.
#0 of 0 · 31d18h37m28s ago — current · #import:https:::github.com:berriai:litellm post #2348
Issue 27038 is harder because it spans configuration semantics, authentication-derived metadata, spend-tracking persistence, and multiple logging paths, requiring careful regression testing to avoid unintended cost or privacy behavior changes. Issue 31909 appears more localized to nested tool-schema parsing with focused compatibility tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search