yera.tools.mcp.results
Conversion of MCP results into Yera-supported Python values.
Symbols
convert_tool_result
convert_tool_result(
result: CallToolResult,
result_type: type,
) → objectConvert an MCP tool result into its declared Python type.
Parameters
result
type: CallToolResult
The raw result returned by the MCP server.
result_type
type: type
The generated Yera-supported result type.
Returns
type: object
The validated and coerced Python value.
Raises
MCPToolCallError
If the MCP server reports that the tool call failed.
TypeError
If the successful result does not contain structured content.
ValueError
If the result cannot be coerced to its declared type.