> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# createToolToken

> Create a per-call SWAIG token for a tool.

[validate-tool-token]: /docs/server-sdks/reference/typescript/agents/agent-base/validate-tool-token

Create a per-call SWAIG token for a given tool, scoped to a specific call. The
token is minted via the agent's `SessionManager`. Returns an empty string on any
failure. Complements [`validateToolToken()`][validate-tool-token].

## **Parameters**

SWAIG function name to create a token for.

Call ID the token is scoped to.

## **Returns**

`string` -- The per-call SWAIG token, or an empty string on failure.

## **Example**

```typescript {5}
import { AgentBase } from '@signalwire/sdk';

const agent = new AgentBase({ name: 'support', route: '/support' });

const token = agent.createToolToken('transfer_call', 'call-abc-123');
console.log(token);
```