Agent tools¶
index.tools() returns tools for an AI agent. Each tool is a plain function
plus a JSON schema, so it works with any framework or API.
| Tool | Arguments | Returns |
|---|---|---|
search_documents |
query, limit, collection |
the best chunks, each with a citation |
get_context |
query, budget |
the best passages, cited, within a budget |
list_documents |
collection |
the documents and their sizes |
outline_document |
reference |
the sections, with numbers and sizes |
read_document |
reference, budget |
a document, a section or pages |
Tools return text, which models read best. Errors come back as text too
(Error: ...), so the model can correct itself.
With an API¶
The principal is bound, never asked¶
principal is fixed when the tools are made. It is not a tool argument, so the
model can't ask for documents its user may not see. Make the tools once per
user (or per request). See Access rules.