# 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.

```
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"
)
```
