smart_search
Searches Tawadoo marketplace listings. Use it when the user asks to find, browse, compare or get recommendations for listings in this category, with or without a budget or preferences. It returns the matching listings with title, price, location, date and link, and the total number of matches. The result is shown in a widget: every listing appears as a card with its photo, price and link, and a View all button opens the full search results page. Do not list the listings again and do not show or add images. Reply in a few sentences that compare or advise about those listings and ask a useful follow-up question. For more results, point the user to the View all button in the widget. Search Tawadoo in one call — automatic category resolution + product search.
Use this when the user gives a broad or ambiguous request and no static vertical tool clearly applies. The server resolves the matching category within a bounded search budget, uses cacheable taxonomy metadata, and returns ranked results ready to evaluate.
Relevant results include auto_display.items, so the widget can render directly from this search response. Call display_recommendations only when you need to curate, reorder, or combine final listings.
smart_search is generic. It does not contain language-specific synonym tables or category-specific business rules. You are responsible for interpreting the user's natural language before calling.
Do not use smart_search for a completely categoryless recommendation request such as "what do you recommend on the site?" when the user gives no product type, use case, budget, or preference. Ask one short clarifying question rather than choosing a category.
When to use
Situation | Use |
Request clearly maps to a major vertical | Use the static vertical tool directly |
Broad, ambiguous, or cross-category request | Use |
Structured criteria + clear vertical | Use the vertical tool — do not start with |
If a brand/model is paired with an implied product vertical, use the static vertical tool rather than smart_search. smart_search is for unresolved category discovery; it can legitimately surface cross-category matches when the query is only a brand/model with no product type.
If smart_search resolves the wrong category branch, correct silently with the appropriate vertical tool. Never tell the user that smart_search confused categories or resolved the wrong branch.
If the exact same request with the same locale and filters was already answered in this conversation, reuse that result rather than calling again. Re-call only when locale, budget, filters, or page changed.
Before calling — decompose the request
Hard criteria (brand, model, capacity, price, fuel type, rooms): keep these in
queryor pass as params; do not drop them silentlyCity / location: never put it in
query,properties, or any other filter param —smart_searchhas no location filter, and a city name is matched as literal search text against listing titles/descriptions, which pollutes results with unrelated listings that merely mention that city. Handle location entirely after the call, by highlighting results whose returnedlocation_labelmatches the user's city.Soft criteria (condition words:
new,like new,clean,no scratches): use a broadqueryfor recall; explain the condition caveat in your answerBroad recommendation wording ("good value", "rapport qualité prix", "pas cher mais bien"): search for the core object (
query="smartphone"), not the recommendation words; compare returned listings by price, condition, and negotiability
query must be short and verbatim-safe. Before including any word, apply this test: "Would this word appear in a listing title or structured property field?" If no, omit it. Keep query to 1–4 terms.
User context (situation, usage, lifestyle) → interpret it, then drop it from
queryQuality adjectives (
fiable,économique,propre,bon état) → omit; they appear in some descriptions but not all, and their absence lowers the relevance score unfairlyBudget amounts → pass as the
budgetparam, never inquery
For broad category searches (user wants "a car", "a phone" with few hard constraints): use 1–2 core product nouns only. A long query inflates query_term_count and can push the match ratio below the relevance threshold even when matching listings exist.
If is_relevant=false, check whether query was too long or contained words unlikely to appear verbatim in listings. If so, retry once with a shorter, core-noun-only query.
For storage or unit wording, normalize before calling: 128go, 128 Go, 128GB, 128 GB, 128 جيغا are the same user intent.
What happens server-side
Fetches cached root categories → picks likely branches for
queryExplores child categories and property-backed result variants
Optionally tests deeper branches within the configured probe budget
Runs
comparewith the resolved category ids and returns ranked results
Evaluate results
Check relevance_assessment first:
Result | Action |
| Proceed — use |
| Stop. Tell the user no relevant listing was found on Tawadoo for this request. |
| Treat as no results unless the user explicitly asked for similar listings |
When there are no results: do not mention rejected categories, technical mismatches, partial results, or close listings. Do not give generic market advice. Offer at most 1–3 short broadening directions — without naming any product, brand, or model:
"I can search with a looser condition"
"I can widen to nearby cities"
"I can look at a related category on Tawadoo"
If the user accepts a broadening direction, run a new tool call for that broader intent.
After this tool returns relevant results, do not call another search tool just to improve or verify the answer. Pick from recommendations/normalized_items, rely on auto_display when it matches your final picks, and call display_recommendations only to curate, reorder, or combine final selected product_url values. Do not call display_recommendations for no-results, weak, diagnostic, or exploratory results.
Responding with listings
Every product you mention must be a Markdown link: [Title](<product_url>). Angle brackets around the URL are required — URLs can end with _ or - and renderers may strip trailing characters without them.
Format for each listing:
Title — Price |
location_label| Date:freshness_label| Negotiable / Not negotiable Why this is a good fit: [personalized explanation]
Always show location_label. If the field is empty, write "Location not specified". Never mention a listing without its location_label.
Always show the listing date. Use freshness_label if present, otherwise published_at. If neither is available, write "Date not specified".
If this tool fails or returns weak results, say so plainly and offer to refine the search.
Args
query: product-type terms only — what the product IS. Interpret the user's context first, then pass only the resulting product attributes.minp/maxp: optional price range. Passmaxp=budgetonly when the user insists on strict filtering.budget: user's exact target budget. Enableswithin_budgetandnegotiation_opportunityper item. The server automatically setsmaxpto 120% to surface negotiable over-budget listings.is_negotiable: filter to negotiable listings onlylocale:"fr","en", or"ar". Use"en"for unsupported languages. Detect from the user's sentence context — not from isolated tokens likeGB,Go,iPhone, orBMW.page: page number starting at 1. Usepage=2when the user asks for more results.
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": {
"query": "<query>"
},
"name": "smart_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maxp | No | ||
| minp | No | ||
| page | No | ||
| query | Yes | ||
| budget | No | ||
| locale | No | fr | |
| is_negotiable | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |