#27840 [Bug]: Tool registry (LiteLLM_ToolTable / LiteLLM_SpendLogToolIndex) not populated for /v1/messages (anthropic_messages) path
## Description
`LiteLLM_ToolTable` and `LiteLLM_SpendLogToolIndex` stay empty for all traffic going through the `/v1/messages` endpoint (the native Anthropic messages API path, `route_type="anthropic_messages"`).
## Root Cause
`_enqueue_tool_registry_upsert` in `litellm/proxy/db/db_spend_update_writer.py` handles four sources for tool names, but misses the non-passthrough `anthropic_messages` path:
1. MCP tool calls via `standard_logging_object.metadata.mcp_tool_call_metadata` โ 2. Request tools in OpenAI format (`kwargs["tools"][].function.name`) โ 3. Request tools in Anthropic pass-through format (`kwargs["passthrough_logging_payload"]["request_body"]["tools"][].name`) โ 4. Response tool calls (`completion_response.choices[].message.tool_calls`) โ
The gap: when a request is routed through `anthropic_messages` (i.e. `llm_router.anthropic_messages(**data)`), the response is an `AnthropicMessagesResponse` โ a plain `TypedDict` with `content[{"type": "tool_use", "name": ..., "input": {...}}]`. This shape is never inspected by `_enqueue_tool_registry_upsert`. The `hasattr(completion_response, "choices")` guard on path 4 is `False` for a dict, so response tool calls are silently dโฆ