Search and lookup
MAIA API tools
Through its connector, the MAIA API gives an assistant two tools. maia_search finds parcels and places by what public records say about them, and send_feedback sends a report to MAIA's team.
A workspace made in the connect step has these two tools and no others. It has no project, upload or run tools, and no prompts.
maia_search#
Finds parcels, and places (businesses and points of interest), from MAIA's index of public records, by what the records say about them: zoning, land use, flood zones, schools, districts, named areas and other mapped facts. It is read-only and covers San Francisco County, CA.
| Input | Required | What it is |
|---|---|---|
query | RequiredYes | What it isWhat to find. Text, searched as one part, or the parts of the query as {"all": [...], "not": [...]}. At most 8 parts |
kind | RequiredNo | What it isThe kind of result: parcel (the default) or place, a business or point of interest. sort and stats are for parcels only |
region | RequiredYes | What it isThe broad place searched: one county or state, by name or FIPS code, such as {"county": ["San Francisco County, CA"]}. A county region also sees that county's own codes, such as its zoning districts |
time | RequiredNo | What it isWhen the facts must be true, as whole days in UTC: from, to, and match as any (the default) or whole. Left out, it is today |
filters | RequiredNo | What it isFor parcels, a minimum, a maximum or both on a number each parcel holds: lot size in acres, the year built, the total assessed value, or the distance in metres to the nearest K-12 school, rail transit station, highway, highway ramp, electric substation or high-voltage transmission line. For places, whether a place is open and its opening hours |
output | RequiredNo | What it islist (the default) returns the results, count how many with a few examples, and stats the count with the minimum, median, mean and maximum of each column |
sort | RequiredNo | What it isOrders a list by one column, asc (the default) or desc. Left out, the best match comes first |
limit | RequiredNo | What it isHow many results a page holds, 1 to 100. The default is 10 |
cursor | RequiredNo | What it isA reply's cursor, with the same request, to read the next page. It is good for 60 minutes |
The parts of a query#
Every item in all must hold for a result. An item is one part, a few words that name one thing, such as schools, M-1 or in the Mission. An item can also be a list of alternatives, any one of which counts, such as ["M-1", "RM-1"]. Each part in not is taken away.
{"all": ["schools", ["M-1", "RM-1"]], "not": ["flood zone"]}MAIA reads nothing out of the text: "or" and "not" go in the structure, not in the words. MAIA joins only what its records already link. To combine results another way, make two searches and combine them.
What it returns#
| Field | What it is |
|---|---|
output | What it islist, count or stats, as asked |
results | What it isFor a list, the page of results. Each has its kind and id, a label to name it by, its values for the columns filtered or sorted by, and the facts about it that matched the query, each naming its sources |
examples | What it isFor a count, a few of the results counted |
count | What it isHow many results fit, over all pages |
stats | What it isFor stats, each column's count, minimum, median, mean and maximum |
sources | What it isEach source a matched fact names: its dataset and, where recorded, its publisher, licence and date |
flags | What it isWhat found nothing, was cut or was left out, each with its part and what to do |
cursor | What it isSet when more results fit than the page holds |
meta | What it isThe call's request id, what it cost and its limits. See Pricing |
When the matched facts are not what a part meant, rephrase that part and search again.
When it refuses#
- A wrong request is refused with the name of the field and the reason.
- A region outside San Francisco County is refused as not covered.
- Too many searches in a minute: the reply says how many seconds to wait.
- The workspace's credits are spent: a charged search is refused before it runs.
- MAIA's team has paused the search: the reply says so, and the assistant answers from what it knows.
send_feedback#
Sends MAIA's team a report: a wrong or unusable result, an error, something MAIA cannot do, a feature request, a confusing reply, a slow answer, or praise. The assistant uses it when you ask, or when a MAIA tool failed or gave a wrong result, once for each problem.
| Input | Required | What it is |
|---|---|---|
kind | RequiredYes | What it iswrong_result, error, missing_capability, feature_request, confusing, slow, praise or other |
message | RequiredYes | What it isWhat was expected, what happened, and any workaround, up to 2,000 characters |
user_asked | RequiredYes | What it isWhether the user asked for the report |
impact | RequiredNo | What it isblocked, worked_around or minor |
tool | RequiredNo | What it isThe MAIA tool the report is about |
project_id, run_id | RequiredNo | What it isA project or run on the platform. An API workspace has none |
The report is stored and reaches MAIA's team with your email, your workspace and the name of your client. The team reads each report and does not reply in the chat.