Skip to content

Commit 6a648b8

Browse files
authored
chore: fix typos (#79)
1 parent 4ca00c2 commit 6a648b8

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

crates/rmcp-macros/src/tool.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ pub(crate) fn tool_fn_item(attr: TokenStream, mut input_fn: ItemFn) -> syn::Resu
360360
// async fn #tool_tool_call(context: rmcp::handler::server::tool::ToolCallContext<'_, Self>)
361361
// -> std::result::Result<rmcp::model::CallToolResult, rmcp::Error>
362362
//
363-
// and the block part shoule be like:
363+
// and the block part should be like:
364364
// {
365365
// use rmcp::handler::server::tool::*;
366366
// let (t0, context) = <T0>::from_tool_call_context_part(context)?;
@@ -383,8 +383,8 @@ pub(crate) fn tool_fn_item(attr: TokenStream, mut input_fn: ItemFn) -> syn::Resu
383383
// for receiver type, name it as __rmcp_tool_receiver
384384
let is_async = input_fn.sig.asyncness.is_some();
385385
let receiver_ident = || Ident::new("__rmcp_tool_receiver", proc_macro2::Span::call_site());
386-
// generate the extraction part for trival args
387-
let trival_args = input_fn
386+
// generate the extraction part for trivial args
387+
let trivial_args = input_fn
388388
.sig
389389
.inputs
390390
.iter()
@@ -413,8 +413,8 @@ pub(crate) fn tool_fn_item(attr: TokenStream, mut input_fn: ItemFn) -> syn::Resu
413413
Some(line)
414414
}
415415
});
416-
let trival_argrextraction_part = quote! {
417-
#(#trival_args)*
416+
let trivial_argrextraction_part = quote! {
417+
#(#trivial_args)*
418418
};
419419
let processed_argrextraction_part = match &mut tool_macro_attrs.params {
420420
ToolParams::Aggregated { rust_type } => {
@@ -441,7 +441,7 @@ pub(crate) fn tool_fn_item(attr: TokenStream, mut input_fn: ItemFn) -> syn::Resu
441441
}
442442
};
443443
// generate the execution part
444-
// has reveiver?
444+
// has receiver?
445445
let params = &input_fn
446446
.sig
447447
.inputs
@@ -487,7 +487,7 @@ pub(crate) fn tool_fn_item(attr: TokenStream, mut input_fn: ItemFn) -> syn::Resu
487487
#raw_fn_vis async fn #tool_call_fn_ident(context: rmcp::handler::server::tool::ToolCallContext<'_, Self>)
488488
-> std::result::Result<rmcp::model::CallToolResult, rmcp::Error> {
489489
use rmcp::handler::server::tool::*;
490-
#trival_argrextraction_part
490+
#trivial_argrextraction_part
491491
#processed_argrextraction_part
492492
#call
493493
}

crates/rmcp/tests/test_complex_schema.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl Demo {
4444
fn test_complex_schema() {
4545
let attr = Demo::chat_tool_attr();
4646
let input_schema = attr.input_schema;
47-
let enum_numer = input_schema
47+
let enum_number = input_schema
4848
.get("definitions")
4949
.unwrap()
5050
.as_object()
@@ -58,6 +58,6 @@ fn test_complex_schema() {
5858
.as_array()
5959
.unwrap()
6060
.len();
61-
assert_eq!(enum_numer, 4);
61+
assert_eq!(enum_number, 4);
6262
println!("{}", serde_json::to_string_pretty(&input_schema).unwrap());
6363
}

examples/rig-integration/src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct Config {
1212
}
1313

1414
impl Config {
15-
pub async fn retrive(path: impl AsRef<Path>) -> anyhow::Result<Self> {
15+
pub async fn retrieve(path: impl AsRef<Path>) -> anyhow::Result<Self> {
1616
let content = tokio::fs::read_to_string(path).await?;
1717
let config: Self = toml::from_str(&content)?;
1818
Ok(config)

examples/rig-integration/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub mod config;
1111
pub mod mcp_adaptor;
1212
#[tokio::main]
1313
async fn main() -> anyhow::Result<()> {
14-
let config = config::Config::retrive("config.toml").await?;
14+
let config = config::Config::retrieve("config.toml").await?;
1515
let openai_client = {
1616
if let Some(key) = config.deepseek_key {
1717
deepseek::Client::new(&key)

examples/servers/src/common/calculator.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ impl Calculator {
2020
(a + b).to_string()
2121
}
2222

23-
#[tool(description = "Calculate the sum of two numbers")]
23+
#[tool(description = "Calculate the sub of two numbers")]
2424
fn sub(
2525
&self,
2626
#[tool(param)]
2727
#[schemars(description = "the left hand side number")]
2828
a: i32,
2929
#[tool(param)]
30-
#[schemars(description = "the left hand side number")]
30+
#[schemars(description = "the right hand side number")]
3131
b: i32,
3232
) -> Json<i32> {
3333
Json(a - b)

examples/servers/src/common/counter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl ServerHandler for Counter {
146146
next_cursor: None,
147147
prompts: vec![Prompt::new(
148148
"example_prompt",
149-
Some("This is an example prompt that takes one required agrument, message"),
149+
Some("This is an example prompt that takes one required argument, message"),
150150
Some(vec![PromptArgument {
151151
name: "message".to_string(),
152152
description: Some("A message to put in the prompt".to_string()),

0 commit comments

Comments
 (0)