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

# Search Trail Rules

> Search the rules stored in one, several, or every Trail in the workspace.

A Trail is a set of rules and procedures the company has written down for a process, such as invoices or payroll. **Search Trail Rules** searches those rules by meaning and returns the closest matches. Display name **"Search Trail Rules"**. **Off by default**; enable it per agent.

The tool does not decide whether a rule applies. It returns what is stored, and the agent reads the results and judges.

## Authentication and enablement

* No external integration. It reads Trails in the running agent's workspace.
* **Off by default.** Not seeded into new agents.
* An agent sees only its own workspace's Trails, and only approved rules.

## Inputs

* `query` (required): what you want to know, in plain words.
* `trails` (optional): Trail names or ids. Leave it out to search every Trail in the workspace. One name searches that Trail. Several names search those Trails.
* `domains` (optional): domain names. Only rules in a domain with that name are searched. The same name in two Trails matches both. Names come from `list_trail_domains_and_tags`.
* `clusters` (optional): cluster names, matched the same way. Combines with `domains`: a rule must be in both.
  `domains` and `clusters` narrow what is searched. They do not change how the remaining rules are ranked. Rules that are not in a domain are left out when either filter is set.

Whatever the scope, it is one search: one reading of the query, one embedding, and one set of lookups, however many Trails it covers. The Trails are not merged in storage.

## Output

One ranked list. Each rule includes its text, rule class, rank, the Trail it came from (name and id), and what in the query it matched.

When two returned rules conflict, both are shown with their Trails and the conflict is named. The tool does not pick a winner.

An empty result means nothing stored matched the query. A Trail, domain, or cluster name that does not exist returns the valid names instead of a result.

## Limits and side effects

* Read-only. It does not create, edit, or approve rules.
* The search is recorded in the Activity tab of each Trail it returned rules from.
* Searching one Trail returns the same rules as `get_brain_context` on that Trail.
* Conflicts between rules in different Trails are not checked when a rule is added. They show up only when a search returns both.

## Expected errors

* Missing `query`.
* An unknown Trail, domain, or cluster name. The error lists the valid names.
* Workspace missing from the call.


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