#26436 [Bug]: `/v1/messages/count_tokens` proxy endpoint returns incorrect token count - `tools` field ignored on Bedrock provider
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
The `/v1/messages/count_tokens` proxy endpoint does not count the `tools` field when routing through Bedrock. Requests that include tool definitions return the same token count as requests without them, indicating the tools are silently discarded from the count.
This was supposedly fixed in PR #22301 (merged 2026-02-27), but we are still seeing the issue on **LiteLLM v1.83.7**.
### Evidence from HTTP intercept
We intercepted all traffic between Claude Code and our LiteLLM proxy. Claude Code sends two `count_tokens` requests to measure tool tokens, one with tools and one without, then takes the difference.
**Request WITH all tool definitions** (42,812 bytes, ~26k tokens of tools): ```json { "model": "claude-opus-4-6", "messages": [{ "role": "user", "content": "foo" }], "tools": [ /* ~30 tool definitions, 42KB */ ] } ``` Response: `{ "input_tokens": 8 }`
**Request WITHOUT tools** (83 bytes): ```json { "model": "claude-opus-4-6", "messages": [{ "role": "user", "content": "foo" }], "tools": [] } ``` Response: `{ "input_tokens": 8 }…