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

# tool

> Contract, placement, related fields and source examples for this Nika YAML field.

[Language reference](https://docs.nika.sh/reference/language/overview.md) / `tool`

## Meaning and placement

### invoke

Tool reference · nika:\<path> (closed v0.1 builtin set) OR mcp:\<server>/\<tool> (requires the slash). The namespace set is CLOSED at v1 (spec/02-verbs.md) — an x-\<vendor>: prefix is RESERVED, not valid (engine-specific tools route through mcp: · spec/06-stdlib-contract.md §Namespace ownership).

| Property | Declaration |
| - | - |
| Requirement | Optional in this object |
| Schema location | `/$defs/invoke/properties/tool` |

**In the same object:** [args](https://docs.nika.sh/reference/language/words/args.md) · [workflow](https://docs.nika.sh/reference/language/words/workflow.md)

[Schema source (use the pointer above)](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/schemas/workflow.schema.json)

## In a source template

Excerpt from `templates/agent-loop.nika`, source lines 123–132. This is a fragment, not a runnable workflow.

```yaml illustration theme={"system"}
      # answer: that gap closes upstream, by binding the goal into the agent.
      has_findings: ${{ size(tasks.execute.output.findings) > 0 }}   # the check crosses as ONE boundary expression · SLOT: your law
    invoke:
      tool: "nika:assert"
      args:
        condition: "${{ with.has_findings }}"
        message: "Agent returned no findings, do not trust an empty run"   # SLOT

outputs:
  findings:
```

### Templates containing this field

| Template | Source |
| - | - |
| `templates/agent-loop.nika` | [Line 126](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/agent-loop.nika#L126) |
| `templates/aggregate-by-key.nika` | [Line 28](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/aggregate-by-key.nika#L28) |
| `templates/api-upload-and-create.nika` | [Line 70](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/api-upload-and-create.nika#L70) |
| `templates/bounded-batch.nika` | [Line 26](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/bounded-batch.nika#L26) |
| `templates/chain.nika` | [Line 48](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/chain.nika#L48) |
| `templates/classify-and-route.nika` | [Line 96](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/classify-and-route.nika#L96) |
| `templates/corpus-qa.nika` | [Line 33](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/corpus-qa.nika#L33) |
| `templates/deduplicate-records.nika` | [Line 28](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/deduplicate-records.nika#L28) |
| `templates/docker-report.nika` | [Line 90](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/docker-report.nika#L90) |
| `templates/document-to-fields.nika` | [Line 39](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/document-to-fields.nika#L39) |
| `templates/etl-state.nika` | [Line 72](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/etl-state.nika#L72) |
| `templates/fanout.nika` | [Line 84](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/fanout.nika#L84) |
| `templates/gate-and-act.nika` | [Line 53](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/gate-and-act.nika#L53) |
| `templates/human-gated-ship.nika` | [Line 95](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/human-gated-ship.nika#L95) |
| `templates/media-asset-pack.nika` | [Line 72](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/media-asset-pack.nika#L72) |
| `templates/parallel-review.nika` | [Line 54](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/parallel-review.nika#L54) |
| `templates/project-public-fields.nika` | [Line 29](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/project-public-fields.nika#L29) |
| `templates/recover-optional-file.nika` | [Line 27](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/recover-optional-file.nika#L27) |
| `templates/snapshot-diff.nika` | [Line 27](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/snapshot-diff.nika#L27) |
| `templates/validate-records.nika` | [Line 26](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/validate-records.nika#L26) |
| `templates/website-brief.nika` | [Line 49](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/website-brief.nika#L49) |

These are literal key occurrences in the source files, not an execution or conformance claim. [How to instantiate a template](https://docs.nika.sh/guides/templates.md).

## Contract and implementation

This page projects the named specification revision. Check [released engine status](https://docs.nika.sh/reference/status.md) and [the validation workflow](https://docs.nika.sh/guides/agent-authoring.md) before running a file. An optional field is not evidence that every engine supports every value.

Canonical identity: `language:word:tool`. Spec revision: [`4e259e5b8012`](https://github.com/supernovae-st/nika-spec/tree/4e259e5b8012fcdf92f094142a52dfef24099b85).

[How documentation stays connected](https://docs.nika.sh/reference/knowledge-system.md).


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