pub enum ToolKind {
Mcp,
Builtin,
Composio,
App,
CoreApi,
Command,
Skill,
}Expand description
Source plane of a catalog entry. Serializes lowercase: mcp|builtin|composio|app,
plus core-api for Core’s own HTTP endpoints exposed as agent-drivable tools,
command for a declarative app tool that execs an allowlisted local CLI, and
skill for an Agent Skill.
§Skill is the one kind that is not callable
Every other variant names a function the model may invoke. ToolKind::Skill
names instruction text the model may load — an Agent Skill discovered through
the same catalog so a model faces one search door instead of two, but reached with
skills__load rather than by calling its id. The kind is the model’s (and the
gateway’s) signal for that distinction: Core’s McpRegistry::describe points a
skill row at skills__load, the gateway declines to inject skill rows as function
definitions, and Core’s skills provider refuses a call that names a skill id as
a tool. Discovery is unified; execution is not.
Variants§
Mcp
Builtin
Composio
App
CoreApi
A Core HTTP endpoint (OpenAPI-derived) callable by an agent over loopback.
Explicit rename so the wire value is the hyphenated core-api, not the
rename_all = "lowercase" default coreapi.
Command
A declarative command app tool: execs an allowlisted local CLI through
the governed tool-exec path. Surfaced as its own kind so ?kind=command
selects these; the other app backends (http/inline_deno/alias) stay App.
Skill
An Agent Skill: instruction text loaded with skills__load, not a
callable function. Ids are namespaced skills__<slug> so a skill row lives
in the same id space as the skills__* tools that serve it — which is what
makes the allowlist arm below, and Core’s refusal path, work without a
bespoke lookup.
Implementations§
Source§impl ToolKind
impl ToolKind
Sourcepub const ALL: &'static [ToolKind]
pub const ALL: &'static [ToolKind]
Every variant, in wire order — the single list both gateway mirrors and
Core’s ACP bridge enumerate when asserting that their advertised
tool_search.kind enum covers every plane Core can filter on.
Adding a variant means adding it here. ToolKind::wire_name below is a
wildcard-free match, so a new variant is a compile error there first; this
constant is two lines above it precisely so the same edit updates both. A
variant present in the enum but missing from ALL would make those mirror
tests pass vacuously — the exact failure mode that let core-api and
command stay invisible to every model for two releases.
Sourcepub const fn wire_name(self) -> &'static str
pub const fn wire_name(self) -> &'static str
The canonical wire spelling — the value ToolKind::parse_filter round-trips
and the one a ?kind= / tool_search.kind filter must use.
Exhaustive with no wildcard arm on purpose: that is the drift alarm. See
ToolKind::ALL.
Sourcepub fn parse_filter(s: &str) -> Option<ToolKind>
pub fn parse_filter(s: &str) -> Option<ToolKind>
Parse the ?kind= / tool_search.kind value. any → None (no filter);
an unknown value also yields None so callers can treat it as “any”.