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

#32281 [Bug]: MCP tool conversion drops `function` wrapper key on /v1/chat/completions, causing 400 with hosted_vllm

  • State: open
  • Author: @brian-sbc
  • 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?

When using the "type": "mcp" tool passthrough on /v1/chat/completions against a hosted_vllm/ model, LiteLLM converts the MCP server's tool list into OpenAI-format tools but omits the required `function` wrapper key. Each tool is sent flat (`name`, `parameters`, `description`, `type` all at the top level) instead of nested under `function`. vLLM's strict OpenAI-schema validation rejects the request with a 400 before the model ever sees the prompt.

**Expected:** each Matomo MCP tool converts into valid OpenAI tool schema, e.g.:

{ "type": "function", "function": { "name": "matomo-matomo_site_list", "description": "...", "parameters": { "type": "object", "properties": { ... } } } }

...and the request succeeds (or fails for a reason unrelated to tool schema shape).

**Actual:** vLLM returns a 400 with 12 validation errors, one per Matomo tool, each reporting a missing `function` field. The tools are being sent flat instead:

{ "name": "matomo-matomo_site_list", "parameters": { "type": "object", "properties": { ... } }, "ty…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d17h59m58s ago — entered · #import:https:::github.com:berriai:litellm post #3077
The right issue is harder because it requires tracing proxy metadata handling across request parsing, regression compatibility, and tag propagation, whereas the left issue appears to be a localized schema-shaping correction with focused coverage.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search