feat!: align model types with MCP 2025-11-25 spec (#927)

* feat!: align model types with MCP 2025-11-25 spec

* fix: complete 2025-11-25 model spec conformance
This commit is contained in:
Dale Seo 2026-06-24 20:41:13 -04:00 • committed by GitHub
commit 77932141e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,7 +5,7 @@ use futures::future::BoxFuture;
use rmcp::{
ServerHandler,
handler::server::wrapper::Parameters,
model::{GetPromptResult, PromptMessage, PromptMessageRole},
model::{GetPromptResult, PromptMessage, Role},
};
#[derive(Debug, Default)]
@ -35,7 +35,7 @@ impl<T> TestHandler<T> {
) -> Vec<PromptMessage> {
drop(fields);
vec![PromptMessage::new_text(
PromptMessageRole::Assistant,
Role::Assistant,
"Async method response",
)]
}
@ -47,7 +47,7 @@ impl<T> TestHandler<T> {
) -> Vec<PromptMessage> {
drop(fields);
vec![PromptMessage::new_text(
PromptMessageRole::Assistant,
Role::Assistant,
"Sync method response",
)]
}
@ -57,7 +57,7 @@ impl<T> TestHandler<T> {
async fn async_function(Parameters(Request { fields }): Parameters<Request>) -> Vec<PromptMessage> {
drop(fields);
vec![PromptMessage::new_text(
PromptMessageRole::Assistant,
Role::Assistant,
"Async function response",
)]
}
@ -66,7 +66,7 @@ async fn async_function(Parameters(Request { fields }): Parameters<Request>) ->
fn async_function2<T>(_callee: &TestHandler<T>) -> BoxFuture<'_, GetPromptResult> {
Box::pin(async move {
GetPromptResult::new(vec![PromptMessage::new_text(
PromptMessageRole::Assistant,
Role::Assistant,
"Async function 2 response",
)])
.with_description("Async function 2")