> ## Documentation Index
> Fetch the complete documentation index at: https://www.getmaxim.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# components.ToolCall

> Tool Call functionality for Components integration.

[View module source on GitHub](https://github.com/maximhq/maxim-py/blob/main/maxim/logger/components/tool_call.py)

## [ToolCallConfig](/sdk/python/references/logger/components/tool_call)

```python theme={null}
@deprecated(
    "This class will be removed in a future version. Use {} which is TypedDict."
)

@dataclass
class ToolCallConfig()
```

[Tool](/sdk/python/references/models/prompt) call config.

This class represents a tool call config.

## [ToolCallConfigDict](/sdk/python/references/logger/components/tool_call)

```python theme={null}
class ToolCallConfigDict(TypedDict)
```

[Tool](/sdk/python/references/models/prompt) call config dict.

This class represents a tool call config dictionary.

#### get\_tool\_call\_config\_dict

```python theme={null}
def get_tool_call_config_dict(
        config: Union[ToolCallConfig,
                      ToolCallConfigDict]) -> ToolCallConfigDict
```

Convert a tool call config to a tool call config dict else return the config.

**Arguments**:

| Name     | Description            |
| -------- | ---------------------- |
| `config` | The config to convert. |

**Returns**:

| Name                                                                       | Description                |
| -------------------------------------------------------------------------- | -------------------------- |
| `[ToolCallConfigDict](/sdk/python/references/logger/components/tool_call)` | The tool call config dict. |

## [ToolCallError](/sdk/python/references/logger/components/tool_call)

```python theme={null}
@deprecated(
    "This class will be removed in a future version. Use {} which is TypedDict instead."
)

@dataclass
class ToolCallError()
```

[Tool](/sdk/python/references/models/prompt) call error.

This class represents a tool call error.

#### get\_tool\_call\_error\_dict

```python theme={null}
def get_tool_call_error_dict(
        error: Union[ToolCallError, ToolCallErrorDict]) -> dict[str, Any]
```

Convert a tool call error to a tool call error dict else return the error.

**Arguments**:

| Name    | Description           |
| ------- | --------------------- |
| `error` | The error to convert. |

**Returns**:

dict\[str, Any]: The tool call error dict.

## [ToolCall](/sdk/python/references/models/prompt)

```python theme={null}
class ToolCall(BaseContainer)
```

[Tool](/sdk/python/references/models/prompt) call.

This class represents a tool call.

#### \_\_init\_\_

```python theme={null}
def __init__(config: Union[ToolCallConfig, ToolCallConfigDict],
             writer: LogWriter)
```

Initialize a tool call.

**Arguments**:

| Name     | Description                                  |
| -------- | -------------------------------------------- |
| `config` | The config to initialize the tool call with. |
| `writer` | The writer to use.                           |

#### update

```python theme={null}
def update(data: Dict[str, Any])
```

Update the tool call.

**Arguments**:

| Name   | Description                            |
| ------ | -------------------------------------- |
| `data` | The data to update the tool call with. |

#### update\_

```python theme={null}
@staticmethod
def update_(writer: LogWriter, id: str, data: Dict[str, Any])
```

Update the tool call.

**Arguments**:

| Name     | Description                            |
| -------- | -------------------------------------- |
| `writer` | The writer to use.                     |
| `id`     | The id of the tool call to update.     |
| `data`   | The data to update the tool call with. |

#### result\_

```python theme={null}
@staticmethod
def result_(writer: LogWriter, id: str, result: str)
```

Update the tool call.

**Arguments**:

| Name     | Description                              |
| -------- | ---------------------------------------- |
| `writer` | The writer to use.                       |
| `id`     | The id of the tool call to update.       |
| `result` | The result to update the tool call with. |

#### attach\_evaluators

```python theme={null}
def attach_evaluators(evaluators: List[str])
```

Attach evaluators to the tool call.

**Arguments**:

| Name         | Description                                |
| ------------ | ------------------------------------------ |
| `evaluators` | The evaluators to attach to the tool call. |

#### result

```python theme={null}
def result(result: str)
```

Update the tool call.

**Arguments**:

| Name     | Description                              |
| -------- | ---------------------------------------- |
| `result` | The result to update the tool call with. |

#### error

```python theme={null}
def error(error: ToolCallError)
```

Add an error to the tool call.

**Arguments**:

| Name    | Description          |
| ------- | -------------------- |
| `error` | The tool call error. |

#### error\_

```python theme={null}
@staticmethod
def error_(writer: LogWriter, id: str, error: Union[ToolCallError,
                                                    ToolCallErrorDict])
```

Add an error to the tool call.

**Arguments**:

| Name     | Description                                  |
| -------- | -------------------------------------------- |
| `writer` | The writer to use.                           |
| `id`     | The id of the tool call to add the error to. |
| `error`  | The tool call error.                         |

#### data

```python theme={null}
def data() -> Dict[str, Any]
```

Get the data for the tool call.

**Returns**:

Dict\[str, Any]: The data for the tool call.
