pub struct McpExecuteError {
pub code: McpErrorCode,
pub message: String,
pub category: McpErrorCategory,
pub retryable: bool,
pub retry_after_seconds: Option<u32>,
pub hint: Option<String>,
pub cause_chain: Vec<String>,
}Expand description
Typed structured-error envelope returned by Everruns’ MCP tools/call
execute path. Serialized into the MCP structuredContent field on
error responses so the legacy content[0].text channel stays
backward-compatible; new SDKs prefer the typed envelope.
See specs/mcp.md for the error contract.
Fields§
§code: McpErrorCodeMachine-readable error code. Closed vocabulary; SDKs that see an
unrecognised value should map it to unknown.
message: StringHuman-readable error message. Mirrors the legacy
content[0].text string for backward compat.
category: McpErrorCategoryBroad-strokes recovery category.
retryable: booltrue when the same call is worth retrying. Distinct from
category == "transient" because a server may know about a
non-transient retry path (e.g. a transient Internal).
retry_after_seconds: Option<u32>Seconds the caller should wait before retrying. Set on
tool_timeout, quota_exceeded, and upstream-unreachable cases
when the server has a concrete back-off hint.
hint: Option<String>Short, agent-readable recovery hint. Free-form; one or two sentences.
cause_chain: Vec<String>Chain of upstream error messages, oldest cause first. Useful for debugging; SDKs should not treat this as machine-readable.
Implementations§
Source§impl McpExecuteError
impl McpExecuteError
Sourcepub fn new(code: McpErrorCode, message: impl Into<String>) -> Self
pub fn new(code: McpErrorCode, message: impl Into<String>) -> Self
Construct an error using the code’s default category and
retryability. Callers can chain .with_* to override.
pub fn with_category(self, category: McpErrorCategory) -> Self
pub fn with_retryable(self, retryable: bool) -> Self
pub fn with_retry_after_seconds(self, seconds: u32) -> Self
pub fn with_hint(self, hint: impl Into<String>) -> Self
pub fn with_cause(self, cause: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for McpExecuteError
impl Clone for McpExecuteError
Source§fn clone(&self) -> McpExecuteError
fn clone(&self) -> McpExecuteError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for McpExecuteError
impl Debug for McpExecuteError
Source§impl<'de> Deserialize<'de> for McpExecuteError
impl<'de> Deserialize<'de> for McpExecuteError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for McpExecuteError
impl RefUnwindSafe for McpExecuteError
impl Send for McpExecuteError
impl Sync for McpExecuteError
impl Unpin for McpExecuteError
impl UnsafeUnpin for McpExecuteError
impl UnwindSafe for McpExecuteError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request