pub trait ToolCatalog: Send + Sync {
// Required method
fn entries(&self) -> &[ToolEntry];
// Provided methods
fn lookup(&self, name: &str) -> Option<&ToolEntry> { ... }
fn specs_for(
&self,
capabilities: &[Capability],
strict: bool,
) -> Vec<ToolSpec> { ... }
fn deferred_specs_for(
&self,
capabilities: &[Capability],
activated: &BTreeSet<String>,
strict: bool,
) -> Vec<ToolSpec> { ... }
fn search_specs(
&self,
capabilities: &[Capability],
query: &str,
limit: usize,
strict: bool,
) -> Vec<ToolSpec> { ... }
}Expand description
The catalog port.
Required Methods§
Provided Methods§
Sourcefn specs_for(&self, capabilities: &[Capability], strict: bool) -> Vec<ToolSpec>
fn specs_for(&self, capabilities: &[Capability], strict: bool) -> Vec<ToolSpec>
The wire-neutral specs an actor holding capabilities may see.
An entry is offered when some capability grants its effect. strict
asks providers with strict-schema support to enforce arguments;
routes without it degrade to local validation.
Sourcefn deferred_specs_for(
&self,
capabilities: &[Capability],
activated: &BTreeSet<String>,
strict: bool,
) -> Vec<ToolSpec>
fn deferred_specs_for( &self, capabilities: &[Capability], activated: &BTreeSet<String>, strict: bool, ) -> Vec<ToolSpec>
Specs for the hot set — entries the catalog marks visible without discovery, which the domain’s common operating loop always is — plus tools activated by a previous host-side search. Names without authority are omitted. This is a context optimization, not an authority boundary; the kernel still checks every call against the complete catalog and held capabilities.
Sourcefn search_specs(
&self,
capabilities: &[Capability],
query: &str,
limit: usize,
strict: bool,
) -> Vec<ToolSpec>
fn search_specs( &self, capabilities: &[Capability], query: &str, limit: usize, strict: bool, ) -> Vec<ToolSpec>
Deterministic lexical search over entries the actor is authorized to discover. External schemas stay deferred until this method selects them, avoiding eager MCP/schema token cost.