pub struct MethodNotFoundError {
pub code: i64,
pub data: Option<Value>,
pub message: String,
}Expand description
A JSON-RPC error indicating that the requested method does not exist or is not available.
In MCP, a server returns this error when a client invokes a method the server does not implement — either a genuinely unknown method, or one gated behind a server capability the server did not advertise (e.g., calling prompts/list when the prompts capability was not advertised).
A request that requires a client capability the client did not declare is signalled instead by MissingRequiredClientCapabilityError (-32021).
Fields§
§code: i64The error type that occurred.
data: Option<Value>Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
message: StringA short description of the error. The message SHOULD be limited to a concise single sentence.
Implementations§
Source§impl MethodNotFoundError
impl MethodNotFoundError
Sourcepub fn new(code: i64, message: String) -> MethodNotFoundError
pub fn new(code: i64, message: String) -> MethodNotFoundError
Creates a value from its required fields; optional fields are None.
Trait Implementations§
Source§impl Clone for MethodNotFoundError
impl Clone for MethodNotFoundError
Source§fn clone(&self) -> MethodNotFoundError
fn clone(&self) -> MethodNotFoundError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more