wrap_tool_call returns an error tool message and does not call the handler when the bearer is missing or userinfo rejects it.
Getting started, including the planned sample, is LangChain.
What fails closed
A tool call with no token returns a tool message unauthorized and does not call the handler.
A tool call with a bearer userinfo accepts calls the handler. whoami returns that subject.
A resolved subject is not authorization. Scopes and allowed tools are a later check. The trust-store sample is that later check for MCP. This page stops at admission.
Related
| Read | To learn how to |
|---|---|
| LangChain | See the hook |
| API keys and M2M for LangChain | Where the secret is allowed to live |
| Authorizing tool calls for LangChain | What happens after the subject is known |