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

# Goals and How TinyAgent Interprets Them

> What a goal controls, what TinyAgent decides on its own, and when to reach for an output schema instead

A goal is the `goal` field you send with a run: a plain-English description of what you want TinyAgent to accomplish on a page. You describe the outcome — TinyAgent works out which clicks, typing, and scrolling get there, not the other way around.

## The mental model

Think of TinyAgent as a capable assistant sitting in front of a browser: it can see what's on the screen, click, type, scroll, and navigate, remember information across steps, and return structured data. What it can't do is read your mind about what you meant or know your business context unless the goal says so. Your job is to remove ambiguity — the more explicit the goal, the fewer steps TinyAgent spends guessing.

## What a goal controls, and what TinyAgent decides on its own

A goal states the outcome, not the sequence of actions. On each step of a run, TinyAgent reads the current page and picks the action that moves the goal forward, then reads the page again once that action lands — nothing in the goal has to spell out "navigate first, then extract." See [How TinyAgent Works](https://docs.tinyfish.ai/tinyagent/explanation/how-tinyagent-works.md) for that loop.

Three things follow from that:

* **The shape of the answer is a judgment call, unless you pin it down.** Without an [output schema](https://docs.tinyfish.ai/tinyagent/explanation/why-output-schema.md), TinyAgent structures `result` from the goal's wording and whatever the page shows — so the same goal can come back with different field names on different sites, or even on the same site over time. Add a schema when your code needs the same shape every run.
* **"Done" is also a judgment call.** If TinyAgent can't fully satisfy the goal — a login wall, a bot check, a step limit — it still ends the run normally and writes what happened into `result`, rather than retrying forever or failing the run outright. See [Runs](https://docs.tinyfish.ai/tinyagent/explanation/runs.md) for what a `COMPLETED` status does and doesn't mean.
* **Explicit beats implicit.** "Fill in my info" doesn't tell TinyAgent what your info is, so it fills the gap with its own reading of the page. Spell out the values, the condition you're checking, or the format you expect — whichever part is ambiguous — instead of leaving it to be inferred. The [Goal Prompting Guide](https://docs.tinyfish.ai/prompting-guide.md) has task-specific patterns for this.

> [!NOTE]
>
> Ambiguity in the goal is cheap to fix and expensive to leave in: an unclear instruction doesn't fail the run, it just means TinyAgent decided something you didn't actually specify.

## Quick examples

**Data extraction:**

```
Extract product name, price, and stock status. Return as JSON.
```

**Form filling:**

```
Fill the contact form with name "John Doe" and email "john@example.com", then click Submit.
```

**Multi-step workflow:**

```
1. Login with email "user@example.com" and password "pass123"
2. Navigate to the dashboard
3. Extract account balance
```

## Related

> [card] [How TinyAgent Works](https://docs.tinyfish.ai/tinyagent/explanation/how-tinyagent-works.md)
>
> What happens between sending a goal and getting a result back

> [card] [Why Use an Output Schema](https://docs.tinyfish.ai/tinyagent/explanation/why-output-schema.md)
>
> Pin down the shape of the answer instead of leaving it to the goal

> [card] [Runs](https://docs.tinyfish.ai/tinyagent/explanation/runs.md)
>
> What happens after you send a goal, and what COMPLETED means

> [card] [Goal Prompting Guide](https://docs.tinyfish.ai/prompting-guide.md)
>
> The anatomy of a great goal, task-specific patterns, and production-ready examples


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