I built a small adapter, claude-p-shim, so another app's bot could run on my Claude subscription instead of paying for its own API key. Rakazo already has an OpenAI-compatible provider, so the shim lives outside Rakazo as its own repo and needs no fork. Upgrades stay an image tag bump.
The bot connecting through it kept failing in a specific way. It would tell me its tools were broken. Not one tool, not intermittently, just broken, every time I asked it to do anything that needed one.
The tools were not the problem
I checked the tools directly. They worked. I reworded my instructions to the bot three separate times, thinking I'd been unclear about what it had access to. Nothing changed. Same complaint, same "tools are broken" response, three times out of three.
The bot had been told about its available tools in its system prompt, as structured text describing names like brain_search. It was supposed to request them through a structured answer that the adapter would then translate into an actual tool call on my side. Instead, the model read "call brain_search" in its own prompt and did exactly that. Directly. As a real tool_use, aimed at a tool that did not exist on my side at all.
Claude answered honestly: no such tool available. The bot read that as confirmation its tools were broken and reported it to me as fact. It wasn't wrong about what it saw, it just saw the wrong thing.
Why telling it the truth didn't help
Here's the part that cost me three rounds of rewording: claude -p --tools "" was supposed to mean no tools offered. It didn't stop Claude from emitting tool_use calls for tool names that showed up in the system prompt text. The model doesn't distinguish "a tool you were told about by another app's instructions sitting in your context" from "a tool I am actually offering you." If a name appears with enough authority in the prompt, the model will call it, flag or no flag.
So the fix wasn't going to come from arguing with the model about what its tools actually were. Two sets of instructions disagreed, mine and the other app's, and the model followed the louder one, which happened to be the one baked into its own system prompt. No amount of rewording my side changed that, because my side was never what it was listening to.
The actual fix
I stopped trying to get the model to behave and changed what the adapter accepts. The shim now reads Claude's output as stream-json instead of a single response. The moment the transcript shows a turn calling any tool name that was offered, the shim ends the run right there and returns it as a proper OpenAI-style tool_calls response. The bot on the other end was always going to try calling tools by name regardless of what I told it; the fix was to catch that attempt and translate it correctly instead of treating it as a failure.
The shim has run that way since, and the "tools are broken" complaints stopped. The lesson that stuck: when a model is handed two conflicting sets of instructions, it doesn't average them or ask for clarification, it just picks one. Usually the one that got there first.