# ToolCall

> **Class** in `langchain_core`

📖 [View in docs](https://reference.langchain.com/python/langchain-core/messages/content/ToolCall)

Represents an AI's request to call a tool.

## Signature

```python
ToolCall()
```

## Description

**Example:**

```python
{"name": "foo", "args": {"a": 1}, "id": "123"}
```

This represents a request to call the tool named "foo" with arguments {"a": 1}
and an identifier of "123".

!!! note "Factory function"

`create_tool_call` may also be used as a factory to create a
`ToolCall`. Benefits include:

* Automatic ID generation (when not provided)
* Required arguments strictly validated at creation time

## Extends

- `TypedDict`

## Constructors

```python
__init__(
    type: Literal['tool_call'],
    id: str | None,
    name: str,
    args: dict[str, Any],
    index: NotRequired[int | str],
    extras: NotRequired[dict[str, Any]],
)
```

| Name | Type |
|------|------|
| `type` | `Literal['tool_call']` |
| `id` | `str \| None` |
| `name` | `str` |
| `args` | `dict[str, Any]` |
| `index` | `NotRequired[int \| str]` |
| `extras` | `NotRequired[dict[str, Any]]` |


## Properties

- `type`
- `id`
- `name`
- `args`
- `index`
- `extras`

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/f0c5a28fa05adcda89aebcb449d897245ab21fa4/libs/core/langchain_core/messages/content.py#L247)