Fuzzy search
fuzzy_searchFind and rank PostgreSQL text column values by trigram similarity to a search term, using word or full-string matching and returning matches with similarity scores.
Instructions
Rank a text column's values by pg_trgm trigram similarity to a search term. mode='word' (default) matches fragments within longer text; mode='full' compares whole strings. Reports available=false if pg_trgm is not installed. Returns an object with available (bool), matches (list of {value, similarity} ranked by similarity descending), and mode.
Example: fuzzy_search(schema='public', table='users', column='name', term='janne', mode='word')
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": {
"schema": "<schema>",
"table": "<table>",
"column": "<column>",
"term": "<term>"
},
"name": "fuzzy_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | word | |
| term | Yes | ||
| limit | No | ||
| table | Yes | ||
| column | Yes | ||
| schema | Yes | ||
| database | No | Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected. | |
| threshold | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| matches | Yes | ||
| available | Yes |