feat!: add MRTR behavior support (SEP-2322) (#929)

* feat!: add MRTR behavior support

* feat: harden SEP-2322 MRTR support

* ci: diff public API only on features common to base and head

cargo public-api builds both revisions with the same feature set, so a
feature introduced (or removed) by a PR broke the build of the other
revision. Restrict the all-features diff to features present in both the
base and head revisions.
This commit is contained in:
Dale Seo 2026-07-10 12:02:26 -04:00 • committed by GitHub
commit dd30a70f84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -213,9 +213,9 @@ impl ServerHandler for ConformanceServer {
&self,
request: CallToolRequestParams,
cx: RequestContext<RoleServer>,
) -> Result<CallToolResult, ErrorData> {
) -> Result<CallToolResponse, ErrorData> {
let args = request.arguments.unwrap_or_default();
match request.name.as_ref() {
let result = match request.name.as_ref() {
"test_simple_text" => Ok(CallToolResult::success(vec![ContentBlock::text(
"This is a simple text response for testing.",
)])),
@ -530,7 +530,8 @@ impl ServerHandler for ConformanceServer {
format!("Unknown tool: {}", request.name),
None,
)),
}
};
result.map(Into::into)
}
async fn list_resources(
@ -555,9 +556,9 @@ impl ServerHandler for ConformanceServer {
&self,
request: ReadResourceRequestParams,
_cx: RequestContext<RoleServer>,
) -> Result<ReadResourceResult, ErrorData> {
) -> Result<ReadResourceResponse, ErrorData> {
let uri = request.uri.as_str();
match uri {
let result = match uri {
"test://static-text" => Ok(ReadResourceResult::new(vec![
ResourceContents::TextResourceContents {
uri: uri.into(),
@ -598,7 +599,8 @@ impl ServerHandler for ConformanceServer {
))
}
}
}
};
result.map(Into::into)
}
async fn list_resource_templates(
@ -679,8 +681,8 @@ impl ServerHandler for ConformanceServer {
&self,
request: GetPromptRequestParams,
_cx: RequestContext<RoleServer>,
) -> Result<GetPromptResult, ErrorData> {
match request.name.as_str() {
) -> Result<GetPromptResponse, ErrorData> {
let result = match request.name.as_str() {
"test_simple_prompt" => Ok(GetPromptResult::new(vec![PromptMessage::new_text(
Role::User,
"This is a simple test prompt.",
@ -721,7 +723,8 @@ impl ServerHandler for ConformanceServer {
format!("Unknown prompt: {}", request.name),
None,
)),
}
};
result.map(Into::into)
}
async fn complete(