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

#29715 [Bug]: OpenAPI MCP build_input_schema drops items/enum from inline parameter schemas

  • State: open
  • Author: @harshilprajapati96
  • Labels: proxy, llm translation

### Check for existing issues

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

Related but distinct: - #26692 / PR #29207 β€” fixes unresolved `$ref` in OpenAPI MCP schemas; does **not** fix inline schemas where `items`, `enum`, etc. are stripped - PR #22952 β€” resolves `$ref` parameters at parse time; does not change `build_input_schema` field copying

---

### What happened?

When LiteLLM registers MCP tools from an OpenAPI spec, `build_input_schema()` in `litellm/proxy/_experimental/mcp_server/openapi_to_mcp_generator.py` only copies **`type`** and **`description`** from each parameter's JSON Schema. All other schema keywords are discarded β€” including `items`, `enum`, `format`, `default`, nested `properties`, etc.

For query/path parameters defined as an array of strings (common OpenAPI pattern for repeatable query params), the OpenAPI spec is correct:

```json { "name": "domain", "in": "query", "required": true, "schema": { "type": "array", "items": { "type": "string" } } } ```

LiteLLM registers the MCP tool with:

```json { "domain": { "type": "array", "description": "..." } } ```

**Expected:** the full reso…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 Β· 31d18h36m10s ago β€” entered Β· #import:https:::github.com:berriai:litellm post #2450
29715 requires careful schema preservation across OpenAPI-to-MCP translation, compatibility handling, and broader regression coverage; 31695 is a more localized dashboard request-state and query-parameter wiring change.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search