Tune vector index
tune_vector_indexRecommend an ivfflat or hnsw configuration for a pgvector column by reading live row count and dimension, applying standard heuristics, and returning parameters with a ready-to-run CREATE INDEX statement.
Instructions
Recommend an ivfflat or hnsw configuration for a pgvector column. Reads the live row count and column dimension, applies the standard pgvector heuristics, and returns the parameters plus a ready-to-run CREATE INDEX statement. Requires the vector 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>",
"column": "<column>"
},
"name": "tune_vector_index"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| column | Yes | ||
| metric | No | l2 | |
| 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. | |
| index_type | No | hnsw |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dimension | Yes | ||
| rationale | Yes | ||
| row_count | Yes | ||
| index_type | Yes | ||
| parameters | Yes | ||
| create_index_sql | Yes |