use std::collections::BTreeMap;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use super::ContractModel;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
#[non_exhaustive]
pub struct ErrorResponse {
pub error: String,
}
impl ContractModel for ErrorResponse {
const SCHEMA: &'static str = "ErrorResponse";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct McpRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
pub jsonrpc: String,
pub method: String,
#[serde(deserialize_with = "super::null_default")]
pub params: BTreeMap<String, Value>,
}
impl ContractModel for McpRequest {
const SCHEMA: &'static str = "MCPRequest";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
#[non_exhaustive]
pub struct McpResponse {
#[serde(deserialize_with = "super::null_default")]
pub error: McpError,
pub id: String,
pub jsonrpc: String,
#[serde(deserialize_with = "super::null_default")]
pub result: BTreeMap<String, Value>,
}
impl ContractModel for McpResponse {
const SCHEMA: &'static str = "MCPResponse";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
#[non_exhaustive]
pub struct McpError {
pub code: i32,
pub message: String,
}
impl ContractModel for McpError {
const SCHEMA: &'static str = "MCPError";
}