draftSearchPlan
query · in the family Reading your records
What it does
Describe what you are looking for in plain words and get a search plan back — the start, the relationships to follow, the conditions on each step — shown in words before anything runs.
Draft ONE search plan from plain words: the assistant routes your words onto the plan grammar — the start family, up to 3 hops along known relationships, each step's conditions — in ONE strict structured call; then each step's conditions pass through the same interpreter the filter builder uses (names resolve inside your tenant; every clause re-validated exactly as hand-built); the assembled plan passes the plan gate before you see it (a refused plan is re-asked once with the gate's own words, then refused VALIDATION/INVALID in the teaching voice). Nothing runs and nothing is saved: the answer is the plan IN words + the exact JSON document searchPlanRun(plan) / startSearchJob(plan) accept — you decide. words is one written ask, 1..500 characters. Refuses INTEGRATION/UNAVAILABLE while the assistant is offline/keyless — build the plan by hand. Requires authentication (user sessions). Every call is cost-metered (at.ai.call.v1 — the route call as office.plan_draft, each step as office.filter_interpret).
Before you call
A signed-in user’s session — the call refuses an API key (AUTHZ/FORBIDDEN).
Capability area: Reading your records — Looking up and listing the records of your organization.
Roles that may call it:
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
What happens
A drafting assist: nothing runs and nothing is saved. The assistant routes your words onto the plan grammar and interprets each step’s conditions (names resolve inside your organization); the plan passes the same gate a hand-built plan passes; you run it with searchPlanRun or startSearchJob. Every call is metered like any other AI call.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
words | String String! | yes |
Returns
SearchPlanDraft SearchPlanDraft! — Nothing has run.
Example request
query ExampleDraftSearchPlan($words: String!) {
draftSearchPlan(words: $words) {
words
planJson
reasoning
}
}Variables:
{
"words": "<words>"
}Example response
{
"data": {
"draftSearchPlan": {
"words": "<words>",
"planJson": "<plan json>",
"reasoning": "<reasoning>"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)