Skip to content

Commit 2ef45a7

Browse files
committed
chore: update add tool name in examples
1 parent 2e6df18 commit 2ef45a7

7 files changed

Lines changed: 16 additions & 16 deletions

crates/rust-mcp-sdk/examples/common/inquiry_utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ impl InquiryUtils {
166166
Ok(())
167167
}
168168

169-
pub async fn call_add_tool(&self, a: i64, b: i64) -> SdkResult<()> {
170-
// Invoke the "add" tool with 100 and 25 as arguments, and display the result
169+
pub async fn call_get_sum_tool(&self, a: i64, b: i64) -> SdkResult<()> {
170+
// Invoke the "get-sum" tool with 100 and 25 as arguments, and display the result
171171
println!(
172172
"{}",
173-
format!("\nCalling the \"add\" tool with {a} and {b} ...").magenta()
173+
format!("\nCalling the \"get-sum\" tool with {a} and {b} ...").magenta()
174174
);
175175

176176
// Create a `Map<String, Value>` to represent the tool parameters
@@ -186,7 +186,7 @@ impl InquiryUtils {
186186
let result = self
187187
.client
188188
.request_tool_call(CallToolRequestParams {
189-
name: "add".to_string(),
189+
name: "get-sum".to_string(),
190190
arguments: Some(params),
191191
meta: None,
192192
task: None,

crates/rust-mcp-sdk/examples/simple-mcp-client-sse-core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ async fn main() -> SdkResult<()> {
8989
// Display the list of resource templates available on the server
9090
utils.print_resource_templates().await?;
9191

92-
// Call add tool, and print the result
93-
utils.call_add_tool(100, 25).await?;
92+
// Call get-sum tool, and print the result
93+
utils.call_get_sum_tool(100, 25).await?;
9494

9595
// // Set the log level
9696
match utils

crates/rust-mcp-sdk/examples/simple-mcp-client-sse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ async fn main() -> SdkResult<()> {
8989
// Display the list of resource templates available on the server
9090
utils.print_resource_templates().await?;
9191

92-
// Call add tool, and print the result
93-
utils.call_add_tool(100, 25).await?;
92+
// Call get-sum tool, and print the result
93+
utils.call_get_sum_tool(100, 25).await?;
9494

9595
// // Set the log level
9696
match utils

crates/rust-mcp-sdk/examples/simple-mcp-client-stdio-core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ async fn main() -> SdkResult<()> {
9191
// Display the list of resource templates available on the server
9292
utils.print_resource_templates().await?;
9393

94-
// Call add tool, and print the result
95-
utils.call_add_tool(100, 25).await?;
94+
// Call get-sum tool, and print the result
95+
utils.call_get_sum_tool(100, 25).await?;
9696

9797
// Set the log level
9898
utils

crates/rust-mcp-sdk/examples/simple-mcp-client-stdio.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ async fn main() -> SdkResult<()> {
9090
// Display the list of resource templates available on the server
9191
utils.print_resource_templates().await?;
9292

93-
// Call add tool, and print the result
94-
utils.call_add_tool(100, 25).await?;
93+
// Call get-sum tool, and print the result
94+
utils.call_get_sum_tool(100, 25).await?;
9595

9696
// Set the log level
9797
utils

crates/rust-mcp-sdk/examples/simple-mcp-client-streamable-http-core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ async fn main() -> SdkResult<()> {
8989
// Display the list of resource templates available on the server
9090
utils.print_resource_templates().await?;
9191

92-
// Call add tool, and print the result
93-
utils.call_add_tool(100, 25).await?;
92+
// Call get-sum tool, and print the result
93+
utils.call_get_sum_tool(100, 25).await?;
9494

9595
// Set the log level
9696
utils

crates/rust-mcp-sdk/examples/simple-mcp-client-streamable-http.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ async fn main() -> SdkResult<()> {
9090
// Display the list of resource templates available on the server
9191
utils.print_resource_templates().await?;
9292

93-
// Call add tool, and print the result
94-
utils.call_add_tool(100, 25).await?;
93+
// Call get-sum tool, and print the result
94+
utils.call_get_sum_tool(100, 25).await?;
9595

9696
// Set the log level
9797
match utils

0 commit comments

Comments
 (0)