Skip to main content

hanzo_client/models/
tool.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Tool {
16    /// Activated is filled by the registry from the activation store for the requesting (org,project); providers leave it zero. An unactivated tool is discoverable but refused 403 at dispatch.
17    #[serde(rename = "activated", skip_serializing_if = "Option::is_none")]
18    pub activated: Option<bool>,
19    /// Description is the prose a model reads to decide whether to call the tool.
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    /// Dispatchable is whether the tool can be CALLED. False for a listing-only entry: a skill is activated and attached to an agent, never called.
23    #[serde(rename = "dispatchable", skip_serializing_if = "Option::is_none")]
24    pub dispatchable: Option<bool>,
25    #[serde(rename = "inputSchema", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub input_schema: Option<Option<serde_json::Value>>,
27    /// Name is the tool's id in the flat, fleet-wide tool namespace — the value a tools/call passes. Unique across sources: a collision is resolved by source precedence before the caller ever sees it.
28    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
29    pub name: Option<String>,
30    /// Price is what a call costs and who is paid, absent for a free tool. Enforcement is the x402 settlement client; this is the declaration.
31    #[serde(rename = "price", skip_serializing_if = "Option::is_none")]
32    pub price: Option<Box<models::Price>>,
33    /// Source is where the tool comes from: connector, function, zap-service, agent, skill or mcp.
34    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
35    pub source: Option<String>,
36}
37
38impl Tool {
39    pub fn new() -> Tool {
40        Tool {
41            activated: None,
42            description: None,
43            dispatchable: None,
44            input_schema: None,
45            name: None,
46            price: None,
47            source: None,
48        }
49    }
50}
51