Module tools

Module tools 

Source
Expand description

Tool execution and user interaction. Tool execution framework with built-in tools.

Re-exports§

pub use crate::client::models::Tool as LLMTool;

Structs§

Answer
Answer to a question - simplified to just question text and answer values.
AskForPermissionsTool
Tool that requests permission from the user for sensitive actions.
AskUserQuestionsRequest
Request to ask user questions.
AskUserQuestionsResponse
Response containing answers to questions.
AskUserQuestionsTool
Tool that asks the user structured questions.
DisplayConfig
Configuration for how a tool should be displayed in the UI.
DisplayResult
Formatted display result from a tool.
PendingPermissionInfo
Information about a pending permission request for UI display.
PendingQuestionInfo
Information about a pending interaction for UI display.
PermissionGrant
A grant that was approved for the session.
PermissionRegistry
Registry for managing permission requests and session-level grants.
PermissionRequest
Request for permission to perform an action.
PermissionResponse
Response to a permission request.
ToolBatchResult
Batch result containing all results from parallel tool executions.
ToolContext
Context provided to tools during execution.
ToolDefinition
Tool definition for the LLM.
ToolExecutor
Manages tool execution with support for parallel batch execution.
ToolRegistry
Thread-safe registry for managing available tools.
ToolRequest
Request to execute a tool.
ToolResult
Result from a single tool execution.
UserInteractionRegistry
Registry for managing pending user interactions.
ValidationError
Validation error response.
ValidationErrorDetail
Detail about a single validation error.
WebSearchTool
Tool that performs web searches using Claude’s built-in capability.

Enums§

PermissionCategory
Categories of permissions that can be requested.
PermissionError
Error types for permission operations.
PermissionScope
Scope of the permission grant.
Question
Question types supported by the tool.
RegistryError
Error type for tool registry operations.
ResultContentType
Content type for formatting tool results.
ToolResultStatus
Result status from tool execution.
ToolType
Tool type classification.
UserInteractionError
Error types for user interaction operations.
ValidationErrorCode
Error codes for validation failures.

Constants§

ASK_FOR_PERMISSIONS_TOOL_DESCRIPTION
AskForPermissions tool description constant.
ASK_FOR_PERMISSIONS_TOOL_NAME
AskForPermissions tool name constant.
ASK_FOR_PERMISSIONS_TOOL_SCHEMA
AskForPermissions tool JSON schema constant.
ASK_USER_QUESTIONS_TOOL_DESCRIPTION
AskUserQuestions tool description constant.
ASK_USER_QUESTIONS_TOOL_NAME
AskUserQuestions tool name constant.
ASK_USER_QUESTIONS_TOOL_SCHEMA
AskUserQuestions tool JSON schema constant.
WEB_SEARCH_TOOL_DESCRIPTION
Web Search tool description constant.
WEB_SEARCH_TOOL_NAME
Web Search tool name constant.
WEB_SEARCH_TOOL_SCHEMA
Web Search tool JSON schema constant.

Traits§

Executable
Trait for executable tools.