# Use Orchard with an agent

## Workflow

1. If the connector slug is known, open /products/orchard/connectors/{slug}/index.md directly. Otherwise translate the user’s task into a short service, capability or column search at [search](https://query.farm/products/orchard/api/v1/search.json?q=weather%20forecast). Read results as candidates; keyword matches are not capability guarantees.
2. Read one format: the connector’s Markdown setup or JSON metadata. Both include pinned recipes and provenance; fetching both is normally unnecessary. For hosting, authentication or capability questions, stop once the requested facts are established without inventing SQL or exploring unrelated objects. Confirm engine 2.0.1, VGI protocol 3.4, deployment availability, required credentials, platforms and input files. Ask for missing choices when they affect the solution.
3. For SQL tasks, follow exact object links already provided by the example or search result. If needed, search with kind=object and connector=<slug>, or browse the paginated object index. Read one representation of each needed object: JSON or Markdown. Preserve function parentheses, schema names, overload argument types and named arguments. Missing defaults and flags are unknown.
4. When execution is requested and prerequisites are available, install the extension and attach the released connector using a supported recipe, and satisfy service/deployment authentication separately. Pin a release for production. Public demo URLs follow the deployed release.
5. Write a query suited to the task. Examples with captured_result have saved execution evidence; other examples do not. Run and inspect a meaningful result when the runtime, credentials and data are available. If execution is unavailable, say that explicitly and list what is needed to verify it.
6. Cite the connector and exact object references. Report the selected release, runtime, prerequisites, SQL and what you actually verified. Do not infer write operations from names such as refunds or payments: inspect the documented operation.

## Search API

GET https://query.farm/products/orchard/api/v1/search.json

| Parameter | Contract |
| --- | --- |
| q | Required; at most 200 characters and 12 searchable terms. Use short phrases rather than a full conversation. |
| kind | connector (default) or object. |
| connector | Optional exact connector slug, especially useful with kind=object. |
| limit | Integer 1–20; default 5. |
| cursor | Opaque cursor returned in nextCursor. Keep q, kind, connector and limit unchanged, or simply follow next. |

Responses have schemaVersion, indexVersion, generatedAt, total, returned, hasMore, nextCursor, next and results. Descriptions are at most 300 characters; the entire JSON response is at most 32768 bytes. If the byte budget shortens a page, next still resumes after the last returned result. Search is keyword/prefix matching with a limited typo fallback. It is not semantic search.

A connector result has links to llms.txt, Markdown and JSON. An object result adds exact object Markdown and JSON links. A matched object under a connector result explains why that connector matched.

Invalid parameters return 400 with error.code and error.message. A cursor from a changed index returns 409 stale_cursor: restart without cursor. Unavailable index data returns 503 data_unavailable: retry later. Unsupported methods return 405. An empty successful result is different from an error. Try a shorter phrase, a service name, or a known column; do not interpret no match as proof that a capability cannot exist.

## Browsing and provenance

The [compact directory](https://query.farm/products/orchard/api/v1/connectors.json) links to each connector. Connector object indexes contain 25 entries per page and a next link. Fetch the few declarations relevant to the task. The older [bulk catalog](https://query.farm/products/orchard/connectors/catalog.json) remains available for compatibility.

Connector JSON separates service-level authentication, declared secret parameters, available hosting, exact installation recipes and per-example evidence. Object JSON preserves every harvested overload, argument, default, named flag, result column, table column and tag. Null or missing metadata is not permission to invent a value. A connector’s catalogVerification describes its harvest; it does not verify a new query against today’s live service.
