Skip to main content
Glama
MCPg - Production-grade PostgreSQL MCP Server

MCPg - Production-grade PostgreSQL MCP Server

Recommend vector quantization

recommend_vector_quantization
Read-only

Scan a PostgreSQL schema for vector columns that can halve storage by switching to halfvec(16-bit), returning per-column byte savings, ratios, and migration rationale.

Instructions

Scan a schema for vector(N) columns whose storage could be halved by switching to pgvector v0.7+'s halfvec(N) type (16-bit float). Returns one recommendation per qualifying column with current vs suggested bytes, the savings ratio, and a one-line rationale. Skips columns that are already non-vector and small tables where the absolute saving wouldn't justify the migration.

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>"
    },
    "name": "recommend_vector_quantization"
  }
}

Input Schema

NameRequiredDescriptionDefault
schemaYes
databaseNoOptional: 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.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.4
    • changedInput schema / properties / database / description
      Previous value: -"Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids."New value: +"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."
  2. First observedv0.6.8

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and openWorldHint=false, and the description is consistent, adding advisory-only framing plus explicit skip rules for small tables. It also describes the shape of each recommendation (current vs suggested bytes, savings ratio, rationale), though some of that overlaps the output schema. It does not mention prerequisites such as pgvector version detection failures.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences, front-loading the qualifying condition and the return shape before the skip rules. No redundant restatement of the title and no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the description needn't detail return values, and it still covers the essential behavioral exclusion rules for a read-only advisory tool with two parameters. The remaining gap is operational: no pointer to `migrate_vector_to_halfvec` as the follow-up action or to `list_schemas` for valid `schema` values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50%: the `database` parameter is well documented in the schema itself, while `schema` has no description. The description partially compensates by implying `schema` is the namespace to scan, but does not say whether it accepts a Postgres schema name, requires `list_schemas` first, or how multiple schemas are handled. Baseline 3 is appropriate given the schema carries half the weight.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: scan a schema for `vector(N)` columns convertible to `halfvec(N)`, and the output is one recommendation per qualifying column. This clearly separates it from listing/diagram tools in the sibling set. It does not explicitly name `migrate_vector_to_halfvec` as the action-taking counterpart, so the recommend-vs-migrate boundary is left to inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives inclusion/exclusion criteria (skips non-`vector` columns and small tables where absolute savings don't justify migration), which implies when the tool is useful. However, it never states the positive trigger (e.g., 'run before planning a storage-reduction migration') nor points to `migrate_vector_to_halfvec` for actually applying the change, leaving the agent to infer the workflow.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools