agtrace_types/tool/kind.rs
1use serde::{Deserialize, Serialize};
2
3/// Tool classification by semantic purpose
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
5#[serde(rename_all = "snake_case")]
6pub enum ToolKind {
7 /// Read operations (files, resources, data)
8 Read,
9 /// Write operations (edit, create, patch)
10 Write,
11 /// Execute operations (shell commands, scripts)
12 Execute,
13 /// Planning operations (todo, task management)
14 Plan,
15 /// Search operations (web, file search, grep)
16 Search,
17 /// User interaction (questions, prompts)
18 Ask,
19 /// Other/unknown operations
20 Other,
21}
22
23/// Tool origin classification
24///
25/// Distinguishes between provider-native tools and MCP protocol tools.
26///
27/// # Important
28/// The origin is determined by how the tool is invoked, not by what it operates on:
29/// - `System`: Tool is built-in to the provider and invoked directly by the LLM
30/// - `Mcp`: Tool is invoked via MCP protocol (typically prefixed with `mcp__`)
31///
32/// # Examples
33/// - `Bash` (Claude Code) → System (provider-native tool)
34/// - `read_mcp_resource` (Codex) → System (provider-native tool that happens to read MCP resources)
35/// - `mcp__sqlite__query` → Mcp (external tool invoked via MCP protocol)
36#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
37#[serde(rename_all = "snake_case")]
38pub enum ToolOrigin {
39 /// System-provided tool (built-in to the provider)
40 System,
41 /// MCP (Model Context Protocol) tool invoked via MCP protocol
42 Mcp,
43}