Skip to main content

register_tools_from_cspace

Function register_tools_from_cspace 

Source
pub fn register_tools_from_cspace(
    registry: &ToolRegistry,
    kernel: &KernelHandle,
    cspace: &CSpace,
    search_cache: Arc<SearchCache>,
    agent_id: AgentId,
)
Expand description

Register tools into registry based on the agent’s CSpace.

First registers the always-on tier (file ops + web search), then walks every capability in the CSpace and conditionally registers the corresponding kernel tools.

§Arguments

  • registry — The agent’s tool registry to populate.
  • kernel — Handle to the kernel for constructing tool instances.
  • cspace — The agent’s capability space (determines which tools are available).
  • search_cache — Shared search cache for web search tools.
  • agent_id — The agent’s ID (used by A2A tools for routing).

§CSpace → Tool mapping

ResourceRefRequired rightsRegistered tools
Exec { .. }EXECUTEExecTool
KernelDomain { "memory" }READMemoryReadTool, MemorySearchTool
KernelDomain { "memory" }WRITEMemoryWriteTool
KernelDomain { "project" }anyProjectTool
KernelDomain { "agent" }anyKernelAgentTool
KernelDomain { "a2a" }anyA2aDelegateTool, A2aSendTool, A2aQueryTool
KernelDomain { "persona" }anyPersonaTool
KernelDomain { "program" }any(deprecated — skills via CSpace)
KernelDomain { "cron" }anyCronTool
KernelDomain { "security" }anySecurityTool
KernelDomain { "budget" }anyBudgetTool
KernelDomain { "resource" }anyResourceTool
KernelDomain { "mcp" }anyMcpToolWrapper
Program { .. }(not registered; surfaced via ToolRetriever)