Skip to content

Commit 2489d90

Browse files
authored
feat: add tool_name() method to CallToolRequest (#52)
* add tool_name() method to CallToolRequest * update
1 parent 92022da commit 2489d90

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

src/generated_schema/2024_11_05/mcp_schema.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
/// modify or extend the implementations as needed, but please do so at your own risk.
66
///
77
/// Generated from : <https://github.com/modelcontextprotocol/specification.git>
8-
/// Hash : bb8f4b7323693910328f72f244352cd71a0689e6
9-
/// Generated at : 2025-03-15 18:47:04
8+
/// Hash : 05530857bb410ecf3a7aa3fb34397385730cbe16
9+
/// Generated at : 2025-03-18 19:06:14
1010
/// ----------------------------------------------------------------------------
1111
///
1212
/// MCP Protocol Version

src/generated_schema/2024_11_05/schema_utils.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,19 @@ impl CallToolResult {
15061506
}
15071507
}
15081508

1509+
impl CallToolRequest {
1510+
/// Retrieves the name of the tool from the request parameters.
1511+
///
1512+
/// This method provides access to the tool name stored within the `params` field
1513+
/// of the `CallToolRequest` struct, returning it as a string reference.
1514+
///
1515+
/// # Returns
1516+
/// A reference to the string containing the tool's name.
1517+
pub fn tool_name(&self) -> &str {
1518+
&self.params.name
1519+
}
1520+
}
1521+
15091522
/// BEGIN AUTO GENERATED
15101523
impl ::serde::Serialize for ClientJsonrpcRequest {
15111524
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>

src/generated_schema/draft/mcp_schema.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
/// modify or extend the implementations as needed, but please do so at your own risk.
66
///
77
/// Generated from : <https://github.com/modelcontextprotocol/specification.git>
8-
/// Hash : bb8f4b7323693910328f72f244352cd71a0689e6
9-
/// Generated at : 2025-03-15 18:47:04
8+
/// Hash : 05530857bb410ecf3a7aa3fb34397385730cbe16
9+
/// Generated at : 2025-03-18 19:06:15
1010
/// ----------------------------------------------------------------------------
1111
///
1212
/// MCP Protocol Version

src/generated_schema/draft/schema_utils.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,19 @@ impl CallToolResult {
15061506
}
15071507
}
15081508

1509+
impl CallToolRequest {
1510+
/// Retrieves the name of the tool from the request parameters.
1511+
///
1512+
/// This method provides access to the tool name stored within the `params` field
1513+
/// of the `CallToolRequest` struct, returning it as a string reference.
1514+
///
1515+
/// # Returns
1516+
/// A reference to the string containing the tool's name.
1517+
pub fn tool_name(&self) -> &str {
1518+
&self.params.name
1519+
}
1520+
}
1521+
15091522
/// BEGIN AUTO GENERATED
15101523
impl ::serde::Serialize for ClientJsonrpcRequest {
15111524
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>

0 commit comments

Comments
 (0)