[**axiom v0.51.1**](../../README.md)

***

[axiom](../../README.md) / [index](../README.md) / wrapTool

# Function: wrapTool()

> **wrapTool**\<`T`\>(`toolName`, `tool`): `T`

Wraps a tool to create child spans when the tool's execute method is called.

## Type Parameters

### T

`T` *extends* `ToolLike`

## Parameters

### toolName

`string`

The name of the tool (key from the tools object) - span name will be `execute_tool <toolName>`

### tool

`T`

The tool to wrap

## Returns

`T`

The same tool but with a wrapped execute method that creates spans
