> For the complete documentation index, see [llms.txt](https://dnotifier.gitbook.io/product-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/example-tool-agent.md).

# Example: Local tool agent

Register a **local tool**, attach it to a **tool agent**, and run it with **`runAgent`** / **`run_agent`**. The model can use the tool when needed; the SDK returns the final answer.

## Flow

```
  input: "What is 21 + 21?"
         │
         ▼
  tool agent (math.add available)
         │
         ▼
  math.add({ a: 21, b: 21 })  // when needed
         │
         ▼
  final output (e.g. "42")
```

{% hint style="info" %}
Use **`transport: "http"`**. For local demos you can set `permissionEnforcement` / `permission_enforcement` to `"disabled"` if you are not using backend permission checks yet.
{% endhint %}

## Prerequisites

1. DNotifier app with AI enabled
2. SDK installed (JS, Python, or Dart)
3. Credentials in the environment

## Language guides

| Language                | Guide                                                                                                                                  |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| JavaScript / TypeScript | [javascript-typescript.md](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/example-tool-agent/javascript-typescript.md) |
| Dart / Flutter          | [dart-flutter.md](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/example-tool-agent/dart-flutter.md)                   |
| Python                  | [python.md](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/example-tool-agent/python.md)                               |

## Expected result

| Field          | Meaning                          |
| -------------- | -------------------------------- |
| `output`       | Final assistant text             |
| `finishReason` | `"stop"`                         |
| `executionId`  | Id for observability correlation |

## Next steps

* [**Tools & MCP overview**](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/tools-and-mcp.md)
* [**Example: MCP Mermaid agent**](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/example-mcp-agent.md)
