database_search
Searches a table that has semantic search on and returns the best rows, whole, as JSON. Four stages run in one statement: an exact match on the primary key or a unique column is pinned first, keyword search and vector search each take their best 200, and the two lists are fused with reciprocal rank fusion (k=60) only after the candidates are joined back to the table under the Product's own role, so a row the role cannot see never moves the rank of one it can. With traverse, the top rows become seeds and their related rows come back too, scored lower with each hop. explain: true returns the compiled SQL, the count and time of every stage, and for each row why it came back. The query itself is embedded (a few tokens, billed at cost). Read-only.
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": {
"productId": "<productId>",
"databaseId": "<databaseId>",
"table": "<table>",
"query": "<query>"
},
"name": "database_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | Rows to return. | |
| query | Yes | What to look for, in words. A primary key value or a unique value is matched exactly. | |
| table | Yes | A table in the database, as schema.table or just table (public is assumed). It needs a single-column primary key. | |
| where | No | Equality filters on columns of the table, e.g. {"scope_id": "prd_..."}. Applied in the same statement, under the same role, before ranking, so a filtered-out row cannot change the rank of one that is returned. | |
| explain | No | Return the plan and per-row reasons as well as the rows. | |
| traverse | No | Follow relationships from the top seeds. Same limits as database_graph_traverse. | |
| productId | Yes | Product identifier, e.g. prd_7k2m9x4qw1nv8bz3ct6d. | |
| databaseId | Yes | Database identifier, from product_get or database_get. |