agentkit-capabilities
Common abstractions for exposing tools, resources, and prompts as model-facing capabilities within the agentkit ecosystem.
This crate provides:
- The
Invocabletrait -- the core interface for anything the model can call during a conversation turn ResourceProviderandPromptProvidertraits for surfacing data and prompt templatesCapabilityProviderfor bundling capabilities from a single source (e.g. an MCP server)- Shared
CapabilityContextthat carries session/turn identifiers across invocations - Common error types used by all capability adapters
When to use this crate
Use agentkit-capabilities when you want to expose non-tool functionality through a
consistent interface that can participate in sessions and turns. For example:
- Wrapping an MCP server so its tools, resources, and prompts appear in the agentic loop
- Building a custom capability that doesn't fit the
Tooltrait inagentkit-tools-core - Creating a
CapabilityProviderthat aggregates multiple backends behind a single facade
If you are building a standard tool (file I/O, shell commands, etc.), you probably want
agentkit-tools-core instead -- it provides a higher-level Tool trait with approval
flows, annotations, and execution context.
Example: implementing a custom Invocable
use ;
use async_trait;
use json;
/// A capability that searches a codebase and returns matching lines.
Example: bundling capabilities with CapabilityProvider
use Arc;
use ;
/// Groups all capabilities exposed by a single backend.