Skip to main content

Crate agentkit_tools_core

Crate agentkit_tools_core 

Source
Expand description

Core abstractions for defining, registering, executing, and governing tools in agentkit.

This crate provides the Tool trait, ToolRegistry, BasicToolExecutor, and a layered permission system built on PermissionChecker, PermissionPolicy, and CompositePermissionChecker. Together these types let you:

Structs§

ApprovalRequest
A request sent to the host when a tool execution needs human approval.
AuthRequest
A request for authentication credentials before a tool can proceed.
BasicToolExecutor
The default ToolExecutor that looks up tools in a ToolRegistry, checks permissions via Tool::proposed_requests, and invokes the tool.
CommandPolicy
A PermissionPolicy that governs ShellPermissionRequests by checking the executable name, working directory, and environment variables.
CompositePermissionChecker
Chains multiple PermissionPolicy implementations into a single PermissionChecker.
CustomKindPolicy
A PermissionPolicy that matches requests whose PermissionRequest::kind starts with "custom." and allows or denies them by name.
McpServerPolicy
A PermissionPolicy that governs McpPermissionRequests by checking whether the target server is trusted and the requested auth scopes are in the allow-list.
OwnedToolContext
Owned execution context that can outlive a single stack frame.
PathPolicy
A PermissionPolicy that governs FileSystemPermissionRequests by checking whether target paths fall within allowed or protected directory trees.
PermissionDenial
Structured denial produced when a PermissionChecker rejects an operation.
ShellPermissionRequest
Permission request for executing a shell command.
ToolAnnotations
Hints that describe behavioural properties of a tool.
ToolCapabilityProvider
A CapabilityProvider that exposes every tool in a ToolRegistry as an Invocable in the agentkit capability layer.
ToolContext
Runtime context passed to every Tool::invoke call.
ToolInvocableAdapter
Wraps a Tool as an Invocable so it can be surfaced through the agentkit capability layer.
ToolName
Unique name identifying a Tool within a ToolRegistry.
ToolRegistry
A name-keyed collection of Tool implementations.
ToolRequest
An incoming request to execute a tool.
ToolResult
The output produced by a successful tool invocation.
ToolSpec
Declarative specification of a tool’s identity, schema, and behavioural hints.

Enums§

ApprovalDecision
The user’s response to an ApprovalRequest.
ApprovalReason
Why a permission policy is requesting human approval before proceeding.
AuthOperation
Describes the operation that triggered an AuthRequest.
AuthResolution
The outcome of an AuthRequest after the user interacts with the auth flow.
FileSystemPermissionRequest
Permission request for a filesystem operation.
McpPermissionRequest
Permission request for an MCP (Model Context Protocol) operation.
PermissionCode
Machine-readable code indicating why a permission was denied.
PermissionDecision
The verdict from a PermissionChecker for a single PermissionRequest.
PolicyMatch
The result of a single PermissionPolicy evaluation.
ToolError
Errors that can occur during tool lookup, permission checking, or execution.
ToolExecutionOutcome
The three-way result of a ToolExecutor::execute call.
ToolInterruption
A tool execution was paused because it needs external input.

Traits§

PermissionChecker
Evaluates a PermissionRequest and returns a final PermissionDecision.
PermissionPolicy
A single, focused permission rule that contributes to a composite decision.
PermissionRequest
A description of an operation that requires permission before it can proceed.
Tool
The central abstraction for an executable tool in an agentkit agent.
ToolExecutor
Trait for executing tool calls with permission checking and interruption handling.
ToolResources
Trait for dependency injection into tool implementations.