Skip to main content

Module dynamic_tools

Module dynamic_tools 

Source
Expand description

Tool categories, the public-surface name lists (local collaboration, internal host hooks, Hive) and the dynamic per-category tool state. Pure name logic: it needs no tool registry, so engine code outside the MCP server reads it here. The call-resolving helpers (ctx_call spellings) stay in server::dynamic_tools, which re-exports this module.

Re-exports§

pub use crate::core::hive_gate::HIVE_TOOLS;

Structs§

DynamicToolState
RemovedTool
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§

ToolCategory

Constants§

INTERNAL_HOST_TOOLS
Host-integration hooks: called by a host extension (the Claude Code mod’s $.mcp.call, through the listed ctx_call since 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 name is 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).