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.758.0
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 /// Free-text description of the tool given to the AI to decide when and how to call it. Overrides the description auto-derived from the underlying script.
24 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
25 pub description: Option<String>,
26 #[serde(rename = "value")]
27 pub value: Box<models::ToolValue>,
28}
29
30impl AgentTool {
31 /// A tool available to an AI agent. Can be a flow module or an external MCP (Model Context Protocol) tool
32 pub fn new(id: String, value: models::ToolValue) -> AgentTool {
33 AgentTool {
34 id,
35 summary: None,
36 description: None,
37 value: Box::new(value),
38 }
39 }
40}
41