# ToolInvocationError

> **Class** in `langgraph.prebuilt`

📖 [View in docs](https://reference.langchain.com/python/langgraph.prebuilt/tool_node/ToolInvocationError)

An error occurred while invoking a tool due to invalid arguments.

This exception is only raised when invoking a tool using the `ToolNode`!

## Signature

```python
ToolInvocationError(
    self,
    tool_name: str,
    source: ValidationError,
    tool_kwargs: dict[str, Any],
    filtered_errors: list[ErrorDetails] | None = None,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `tool_name` | `str` | Yes | The name of the tool that failed. |
| `source` | `ValidationError` | Yes | The exception that occurred. |
| `tool_kwargs` | `dict[str, Any]` | Yes | The keyword arguments that were passed to the tool. |
| `filtered_errors` | `list[ErrorDetails] \| None` | No | Optional list of filtered validation errors excluding injected arguments. (default: `None`) |

## Extends

- `ToolException`

## Constructors

```python
__init__(
    self,
    tool_name: str,
    source: ValidationError,
    tool_kwargs: dict[str, Any],
    filtered_errors: list[ErrorDetails] | None = None,
) -> None
```

| Name | Type |
|------|------|
| `tool_name` | `str` |
| `source` | `ValidationError` |
| `tool_kwargs` | `dict[str, Any]` |
| `filtered_errors` | `list[ErrorDetails] \| None` |


## Properties

- `message`
- `tool_name`
- `tool_kwargs`
- `source`
- `filtered_errors`

---

[View source on GitHub](https://github.com/langchain-ai/langgraph/blob/398d6cc59d4cf81ab23c09f037e9f521c3fedcd6/libs/prebuilt/langgraph/prebuilt/tool_node.py#L339)