Turn a target into categories
suggest_categoriesEntry point for ANY target: call it before any search, and never invent category ids. Give the target in plain words, WITHOUT the place ("independent car repair shops", "restaurants that could use an online booking tool") and the area from find_areas. Primavera's engine picks the Google Maps categories in groups and counts them in the area. Returns "selection" (groups, categories left out and why, what the data cannot tell) and "search", the object that count_search, get_search_metrics, preview_search, estimate_list and create_list take: pass it on as is, or edited. Costs 100 credits (maxCredits ≥ 100), refunded when no selection comes back. A request too vague is refused with clarification_needed, refunded: ask the user the question in error.details, then call again with the answer.
Paid: maxCredits (the most credits this call may spend, never exceeded) and idempotencyKey (a new UUID v4 for this operation) are required; without them nothing runs. To retry after an error or a timeout, send the same idempotencyKey with the same arguments: nothing is charged twice. Ask the user before calling it.
Same call as POST /api/v1/categories/suggest of the REST API.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"request": "<request>",
"maxCredits": "<maxCredits>",
"idempotencyKey": "<idempotencyKey>"
},
"name": "suggest_categories"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| area | No | Area to search, as returned by GET /areas (field "area"). Default: that of "search", else the whole country. | |
| search | No | A search to refine: its area, filters, exclusions and groups are kept (the groups become the previous selection). The "search" object returned by suggest_categories (target, area, filters, sort), sent as is or edited; its full schema is the "search" input of count_search. An invalid search is refused with invalid_request and the fields to fix. | |
| country | No | Country to search (default: that of "search", else fr). | |
| request | Yes | The target as the user would say it, WITHOUT the place: "independent car repair shops", "restaurants that could use a booking tool". What the client sells works too. | |
| previous | No | The selection to update (default: the groups of "search"); null starts afresh. | |
| maxCredits | Yes | Must be at least 100: the price of a suggestion. | |
| idempotencyKey | Yes | A new UUID v4 for this operation (sent as the Idempotency-Key of the API). Reuse it only to retry the very same call: the saved result comes back, nothing is charged twice. |