Skip to main content

ToolCatalog

Trait ToolCatalog 

Source
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§

Source

fn entries(&self) -> &[ToolEntry]

Every registered entry.

Provided Methods§

Source

fn lookup(&self, name: &str) -> Option<&ToolEntry>

Look up one entry by tool name.

Source

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.

Source

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.

Source

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.

Implementors§