Skip to main content

aether_core/events/
tool_event.rs

1use llm::{ToolCallError, ToolCallRequest, ToolCallResult, ToolDefinition};
2use mcp_utils::display_meta::ToolResultMeta;
3use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5
6/// Tool call lifecycle events.
7#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
8#[serde(tag = "type", rename_all = "snake_case")]
9pub enum ToolEvent {
10    /// The LLM requested a tool call; arguments may still be streaming.
11    Call { request: ToolCallRequest },
12    /// A chunk of streamed tool call arguments.
13    CallUpdate { tool_call_id: String, chunk: String },
14    /// The tool began executing.
15    ExecutionStarted { tool_id: String, tool_name: String },
16    /// Progress reported by an executing tool.
17    Progress { request: ToolCallRequest, progress: f64, total: Option<f64>, message: Option<String> },
18    /// The tool completed successfully.
19    Result { result: ToolCallResult, result_meta: Option<ToolResultMeta> },
20    /// The tool failed.
21    Error { error: ToolCallError },
22    /// The set of available tool definitions changed.
23    DefinitionsUpdated { tools: Vec<ToolDefinition> },
24}