Skip to main content

objectiveai_sdk/mcp/tool/
list.rs

1//! Types for tools/list requests and responses.
2
3use indexmap::IndexMap;
4use schemars::JsonSchema;
5use serde::{Deserialize, Serialize};
6
7/// Parameters for a `tools/list` request.
8#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
9#[schemars(rename = "mcp.tool.ListToolsRequest")]
10pub struct ListToolsRequest {
11    /// An opaque cursor for pagination.
12    #[serde(skip_serializing_if = "Option::is_none")]
13    #[schemars(extend("omitempty" = true))]
14    pub cursor: Option<String>,
15}
16
17/// The server's response to a `tools/list` request.
18#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
19#[schemars(rename = "mcp.tool.ListToolsResult")]
20pub struct ListToolsResult {
21    /// The list of tools available on the server.
22    pub tools: Vec<super::Tool>,
23    /// An opaque cursor for fetching the next page.
24    #[serde(skip_serializing_if = "Option::is_none")]
25    #[schemars(extend("omitempty" = true))]
26    #[serde(rename = "nextCursor")]
27    pub next_cursor: Option<String>,
28    /// Extension metadata.
29    #[serde(skip_serializing_if = "Option::is_none")]
30    #[schemars(extend("omitempty" = true))]
31    pub _meta: Option<IndexMap<String, serde_json::Value>>,
32}