Skip to main content

oxios_kernel/tools/
tool_types.rs

1//! Generic tool definition types.
2//!
3//! `ToolDef` and `ArgumentDef` are shared across MCP adapters and other
4//! tool-bridging code. They originally lived in the `program` module but
5//! were extracted here as part of the RFC-009 Skill unification.
6
7use serde::{Deserialize, Serialize};
8
9/// Definition of a tool exposed by an external source (MCP server, etc.).
10#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct ToolDef {
12    /// Tool name (unique within the source).
13    pub name: String,
14    /// Brief description of what the tool does.
15    pub description: String,
16    /// Expected arguments.
17    pub arguments: Vec<ArgumentDef>,
18    /// Command to execute (first word = binary, rest = default args).
19    #[serde(default)]
20    pub command: String,
21}
22
23/// Argument definition for a tool.
24#[derive(Debug, Clone, Serialize, Deserialize)]
25pub struct ArgumentDef {
26    /// Argument name.
27    pub name: String,
28    /// Description of the argument.
29    pub description: String,
30    /// Whether this argument is required.
31    pub required: bool,
32    /// Default value if not provided.
33    pub default: Option<String>,
34}