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

# mergeToolCall

```typescript
mergeToolCall(prior: undefined | ToolCall, patch: Record<string, unknown>): undefined | ToolCall
```

Fold one `tool_call` / `tool_call_update` patch — or a permission request's
`toolCall` reference, which has the same shape — into a merged
[ToolCall](https://docs.devin.ai/sdk/reference/interfaces/ToolCall.md) snapshot. Returns `undefined` when the patch carries no
`toolCallId`.

## Parameters

**prior** `undefined | ToolCall` *required*

**Type:** `undefined | ToolCall`

**patch** `Record\<string, unknown\>` *required*

## Returns

`undefined | ToolCall`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.