9 views
-/https://github.com/berriai/litellm/issues/28515
GitHub · issue

#28515 Gemini hallucinates tool argument names when input_schema is in claude-agent-sdk's 'bare field' shape

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

## Summary

When the wallet's tools are defined via `claude-agent-sdk`'s `@tool` decorator, the `input_schema` is emitted in a non-standard "bare field" shape:

```json { "to": {"type": "string", "description": "Recipient", "required": true}, "amount": {"type": "string", "description": "Amount", "required": true}, "token": {"type": "string", "description": "Token symbol"} } ```

Anthropic's `/v1/messages` API tolerates this. MiniMax (Anthropic-compatible upstream) tolerates this. **Gemini does not** — LiteLLM's `_build_vertex_schema` correctly looks for `properties` (per the JSON Schema spec), finds none, and `filter_schema_fields` strips the schema down to `{"type": "object"}`.

The Gemini model then receives an empty schema for a tool named `transfer` and **hallucinates field names** from the tool description text (e.g., `dst_address` instead of `to`, `coin` instead of `token`).

## Reproduction

Tool definition (via claude-agent-sdk @tool): ```python @tool("transfer", "Send tokens to an address.", { "to": {"type": "string", "description": "Recipient", "required": True}, "amount": {"type": "string", "description": "Amount", "required": True}, "token": {"…

GitHub resolver

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

Refresh page
vote history (3 events)
#0 of 0 · 31d18h18m3s ago — entered · #import:https:::github.com:berriai:litellm post #2537
The left issue requires targeted translation-layer changes, careful compatibility handling, and regression coverage across provider/schema variants. The right issue is primarily coordination and scope definition with little or no direct engineering implementation.
28259 requires security-sensitive execution isolation, timeout semantics, and broader threat-model validation; 28515 is a comparatively localized schema-normalization and provider-translation fix.
#0 of 0 · 31d17h48m7s ago — current · #import:https:::github.com:berriai:litellm post #3059
Adding several upstream model variants requires broader provider mapping, capability handling, and multi-model validation, whereas the other issue is a focused schema-normalization fix with contained regression testing.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search