Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mcp-use.com/llms.txt

Use this file to discover all available pages before exploring further.

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):