use crate::error::not_implemented_result;
use rmcp::{handler::server::wrapper::Parameters, model::CallToolResult, ErrorData as McpError};
use schemars::JsonSchema;
use serde::Deserialize;
#[derive(Debug, Deserialize, JsonSchema, Default)]
#[serde(deny_unknown_fields)]
pub struct InitParams {}
pub(crate) async fn handle(
_state: &crate::ServerState,
Parameters(_p): Parameters<InitParams>,
) -> Result<CallToolResult, McpError> {
Ok(not_implemented_result("init"))
}
#[cfg(test)]
mod tests {
use super::*;
use rmcp::handler::server::tool::schema_for_type;
#[test]
fn init_params_schema_resolves() {
let _ = schema_for_type::<InitParams>();
}
#[tokio::test]
async fn init_happy_path_returns_not_implemented_envelope() {
let s = crate::ServerState::for_tests();
let r = handle(&s, Parameters(InitParams::default())).await.unwrap();
assert_eq!(r.is_error, Some(true), "stub must mark isError");
}
}