AgentCliTools extension

The /tools command, capability mapping, and live scope resolution.

on

Properties

globalTools → ToolsConfig?

Available on AgentCli, provided by the AgentCliTools extension

The live global tools: scope for the host's persistence; null before the first availability rebuild.
no setter

Methods

rebuildToolAvailability() → Future<void>

Available on AgentCli, provided by the AgentCliTools extension

Re-reads every scope, resolves availability, and re-applies it to the live registry/prompt/executor: safe to call at any time (idempotent).
refilterMcpTools(ToolAvailabilityResolution resolution) → void

Available on AgentCli, provided by the AgentCliTools extension

Re-filters the dynamic MCP surface against resolution: disabled servers get their tools unregistered (and their names noted so the gate tombstones them), re-enabled servers get their tools registered straight from the manager — no server restart (AC13). Under a load preset (issue #680) an ENABLED-but-demoted family stays OUT of the schema until mounted: allowed to connect is not the same as loaded.
resyncMcpAvailability() → void

Available on AgentCli, provided by the AgentCliTools extension

Re-applies availability to the fresh MCP surface after a server connect/fail/drop: the default mode re-filters through the standing resolution (cheap — byte-identical REG); under a load preset the late server must RE-RESOLVE (issue #680): the demotion covers the live server set, so the fresh family enters discoverableIds instead of leaking its schemas into every request.
syncDiscoverToolsTool() → void

Available on AgentCli, provided by the AgentCliTools extension

Registers or unregisters the discover_tools meta tool (issue #680) so the registry matches the LIVE load mode: present only in omp (discoveryEnabledByLoadMode — pi is pi-mono's exact benchmark shape, discovery off, issue #679; the default mode has no demotion and stays byte-identical). The tool carries no availability id, so it sits outside the gate's groups and no resolution can hide it. Called from rebuildToolAvailability, so a mid-session mode switch syncs it.
toolCapabilities() → Map<String, ToolCapability>

Available on AgentCli, provided by the AgentCliTools extension

The host wiring as capabilities: the hard floor below config.
toolGroups() → Map<String, List<AgentTool>>

Available on AgentCli, provided by the AgentCliTools extension

Groups the full static tool set by availability id, from the SAME instances the constructor registered. The boot hook stores this map in _toolGroupsById; the sqlite variant swap replaces the read entry in place so the gate always re-registers the current variant.