# tinker_cookbook.tool_use.error_tool_result ### [**tinker_cookbook.tool_use.error_tool_result**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/tool_use/tools.py#L88)(*error_msg*, *call_id*, *name*, *error_type*, *should_stop*) Helper function to create an error ToolResult. **Parameters:** - [**error_msg**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/tool_use/tools.py#L89) (*str*) – The error message to return. - [**call_id**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/tool_use/tools.py#L91) (*str*) – The tool call ID (usually from ToolInput). - [**name**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/tool_use/tools.py#L92) (*str*) – The tool name. - [**error_type**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/tool_use/tools.py#L93) (*str*) – Error category for metadata (e.g., "validation_failed"). - [**should_stop**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/tool_use/tools.py#L94) (*bool*) – Whether to stop the episode after this error. **Returns:** A ToolResult with error message and metadata. ```python except Exception as e: return error_tool_result( f"Parameter validation failed: {e}", call_id=input.call_id or "", name=self.name, error_type="validation_failed" ) ```