PG search more like this
pg_search_more_like_thisFind rows similar to a seed document using PostgreSQL pg_search more_like_this, returning matching IDs and relevance scores for similarity search.
Instructions
Find rows similar to a seed document via pdb.more_like_this + @@@. document_id is the value of key_field for the seed row. All nine documented pdb.more_like_this tuning args (fields jsonb, min_doc_frequency, max_doc_frequency, min_term_frequency, max_query_terms, min_word_length, max_word_length, boost_factor, stop_words) are optional kwargs — when omitted the wrapper does not mention them in the SQL so upstream's defaults apply. Returns the same {id, score} hit shape as pg_search_run. Requires the pg_search extension.
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>",
"document_id": "<document_id>",
"key_field": "<key_field>",
"limit": "<limit>"
},
"name": "pg_search_more_like_this"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | Yes | ||
| table | Yes | ||
| fields | No | ||
| 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. | |
| key_field | Yes | ||
| stop_words | No | ||
| document_id | Yes | ||
| boost_factor | No | ||
| max_query_terms | No | ||
| max_word_length | No | ||
| min_word_length | No | ||
| max_doc_frequency | No | ||
| min_doc_frequency | No | ||
| min_term_frequency | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |