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

#27105 [Bug]: mcp_semantic_tool_filter produces invalid OpenAI tool schema for OpenAI-compatible backends

  • State: open
  • Author: @alekhed
  • Labels: bug, proxy, llm translation

### Check for existing issues

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

### What happened?

**Summary**

When mcp_semantic_tool_filter is enabled, LiteLLM forwards MCP tools to OpenAI-compatible backends (e.g. LM Studio) in an invalid schema.

Tools are sent without the required function wrapper, causing strict OpenAI-compatible APIs to return 400 BadRequest.

**Environment**

- LiteLLM Proxy (v1.83.10) - Backend: LM Studio (OpenAI-compatible API) - Model: openai/gpt-oss-20b - Feature: mcp_semantic_tool_filter: enabled

**Actual Behavior**

LiteLLM sends tools in this format:

```json "tools": [ { "type": "function", "name": "mymcp-tracker_get_issue", "description": "...", "parameters": { ... } } ] ```

Backend error:

```json [ { "code": "invalid_type", "expected": "object", "received": "undefined", "path": [0, "function"], "message": "Required" } ] ```

**Expected Behavior**

Tools should follow OpenAI function-calling schema:

```json "tools": [ { "type": "function", "function": { "name": "mymcp-tracker_get_issue", "description": "...", "parameters": { ... } …

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h8m2s ago — entered · #import:https:::github.com:berriai:litellm post #2717
Issue 33326 is harder because it affects shared budget-state key design, expiration semantics, concurrent accounting, distributed-cache behavior, and compatibility across multiple limiter paths. Issue 27105 is comparatively localized to request-schema normalization in a feature-specific translation path with focused regression coverage.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search