pub struct InvalidParamsError {
pub code: i64,
pub data: Option<Value>,
pub message: String,
}Expand description
A JSON-RPC error indicating that the method parameters are invalid or malformed.
In MCP, this error is returned in various contexts when request parameters fail validation:
- Tools: Unknown tool name or invalid tool arguments
- Prompts: Unknown prompt name or missing required arguments
- Pagination: Invalid or expired cursor values
- Logging: Invalid log level
- Elicitation: Server requests an elicitation mode not declared in client capabilities
- Sampling: Missing tool result or tool results mixed with other content
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 InvalidParamsError
impl InvalidParamsError
Sourcepub fn new(code: i64, message: String) -> InvalidParamsError
pub fn new(code: i64, message: String) -> InvalidParamsError
Creates a value from its required fields; optional fields are None.
Trait Implementations§
Source§impl Clone for InvalidParamsError
impl Clone for InvalidParamsError
Source§fn clone(&self) -> InvalidParamsError
fn clone(&self) -> InvalidParamsError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InvalidParamsError
impl Debug for InvalidParamsError
Source§impl<'de> Deserialize<'de> for InvalidParamsError
impl<'de> Deserialize<'de> for InvalidParamsError
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<InvalidParamsError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<InvalidParamsError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for InvalidParamsError
impl PartialEq for InvalidParamsError
Source§impl Serialize for InvalidParamsError
impl Serialize for InvalidParamsError
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for InvalidParamsError
Auto Trait Implementations§
impl Freeze for InvalidParamsError
impl RefUnwindSafe for InvalidParamsError
impl Send for InvalidParamsError
impl Sync for InvalidParamsError
impl Unpin for InvalidParamsError
impl UnsafeUnpin for InvalidParamsError
impl UnwindSafe for InvalidParamsError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more