Expand description
The name logic lives in lean_ctx::core::dynamic_tools; this module keeps the
helpers that resolve a call through ctx_call/ctx to its inner tool.
Structs§
- Dynamic
Tool State - Removed
Tool - A tool that was removed: folded into a primary tool (#509) or retired
without a successor (focus release, 2026-10). Only the name survives, so a
call from an older agent prompt or config gets the way forward instead of
a bare “Unknown tool” (
docs/migration/focus-2026-10.md).
Enums§
Constants§
- HIVE_
TOOLS - Hive MCP tools, gated with the connector (see
crate::core::hive_gate::HIVE_TOOLS). Hive MCP tools. They ship with the connector but follow its release switch (available_locally, owner 28.10.): while it is off they are in no tool list and every call answersTOOL_NOT_AVAILABLE. - INTERNAL_
HOST_ TOOLS - Host-integration hooks: called by a host extension (the Claude Code mod’s
$.mcp.call, through the listedctx_callsince hosts may refuse unlisted tools, #2089), never by an agent. Advertising them would only spend prompt tokens on a tool the model must not use. - LOCAL_
COLLABORATION_ COMPATIBILITY_ TOOLS - Local collaboration substrate that remains callable for installed users but is excluded from every public MCP tool surface.
Functions§
- categorize_
tool - global
- init_
all_ enabled - init_
from_ config - Initializes the global state from user config (env var > config.toml > default).
Call once during server startup after config is loaded.
If the global was already initialized (e.g. by a concurrent
global()call), applies the categories to the existing state instead. - is_
local_ collaboration_ compatibility_ tool - Whether a registered tool is retained only for local compatibility and must never be advertised from a public tool-definition path.
- is_
publicly_ advertised_ tool - Whether a registered tool belongs on a public MCP tool surface.
- is_
readonly_ tool - is_
withheld_ hive_ tool - Whether
nameis a Hive tool withheld by the release switch. - removed_
tool - The successor and migration hint for a removed tool name, else
None. - removed_
tool_ message - The error text for a call to a removed tool. Stable per name (no timestamps/counters) so provider-side prompt caching stays byte-stable (#498).
- targets_
internal_ host_ tool - Whether a call — direct, or through
ctx_call/ctx— targets an internal host hook. A host replaces a native tool’s output with the hook’s success body, so every gate refusal on such a call must read as an error: then the host keeps the original output instead of a block message (#2089). - withheld_
hive_ tool_ refusal - The fixed answer for a call — direct, or through
ctx_call/ctx— to a withheld Hive tool, elseNone. Stable text (#498).