---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/tools/_shared/functions/runToolGate.md
---

# Function: runToolGate()

```ts
function runToolGate(
  gate: ToolGateFn | undefined,
  ctx: unknown,
  tool: string,
  args: unknown,
): Promise<void>;
```

Defined in: [src/batteries/tools/\_shared/index.ts:288](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/tools/_shared/index.ts#L288)

Await a configured [ToolGateFn](../type-aliases/ToolGateFn.md) (no-op when absent). Factory batteries call this at
the top of their handlers so the gate runs before any side effect.

## Parameters

| Parameter | Type                                                         | Description                                |
| --------- | ------------------------------------------------------------ | ------------------------------------------ |
| `gate`    | [`ToolGateFn`](../type-aliases/ToolGateFn.md) | `undefined` | The configured gate, if any.               |
| `ctx`     | `unknown`                                                    | The dispatch context the handler received. |
| `tool`    | `string`                                                     | The tool name (post-override).             |
| `args`    | `unknown`                                                    | The validated tool args.                   |

## Returns

`Promise`<`void`>
