windmill_api/models/
agent_tool.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.592.1
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// AgentTool : A tool available to an AI agent. Can be a flow module or an external MCP (Model Context Protocol) tool
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct AgentTool {
17    /// Unique identifier for this tool. Cannot contain spaces - use underscores instead (e.g., 'get_user_data' not 'get user data')
18    #[serde(rename = "id")]
19    pub id: String,
20    /// Short description of what this tool does (shown to the AI)
21    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
22    pub summary: Option<String>,
23    #[serde(rename = "value")]
24    pub value: Box<models::ToolValue>,
25}
26
27impl AgentTool {
28    /// A tool available to an AI agent. Can be a flow module or an external MCP (Model Context Protocol) tool
29    pub fn new(id: String, value: models::ToolValue) -> AgentTool {
30        AgentTool {
31            id,
32            summary: None,
33            value: Box::new(value),
34        }
35    }
36}
37