Skip to main content

format_error

function format_error

Formats an exception into a structured format that can be understood by LLMs.
from mcp_use.errors.error_formatting import format_error
Parameters
error
Exception
required
The exception to format.
context
required
Parameter value
Returns
returns
dict
A dictionary containing the formatted error.
Signature
def format_error(error: Exception, context):
I