#27158 [Bug] Anthropic chat transformer KeyError on Anthropic-native managed tools (web_search_20250305 et al.)
## Summary
`AnthropicConfig._transform_request` in `litellm/llms/anthropic/chat/transformation.py` raises `KeyError: 'function'` when callers pass Anthropic-native managed tools such as `web_search_20250305`, `text_editor_*`, `bash_*`, or `computer_*`. The code path assumes any tool that doesn't already have an `input_schema` key is an OpenAI-shaped tool that needs unwrapping via `tool["function"]` — but Anthropic-native managed tools have neither key.
## Affected versions
Reproduces on `v1.51.0-stable` (the `main-v1.51.0-stable` Docker image). The same code path appears unchanged on later 1.51.x tags.
## Affected routes
Both the Anthropic-direct provider (`anthropic/...`) and the Vertex AI Anthropic provider (`vertex_ai/claude-...`) hit this — the transformer module is shared.
## Repro
```python import litellm
litellm.completion( model="anthropic/claude-sonnet-4-5", messages=[{"role": "user", "content": "What's today's news? Use web search."}], tools=[{ "type": "web_search_20250305", "name": "web_search", "max_uses": 3, }], max_tokens=200, ) ```
## Stack trace
``` File "/usr/local/lib/python3.11/site-packages/litellm/llms/anthr…