Skip to main content
Glama
Datris MCP Server

Datris MCP Server

search_pgvector

Convert a natural language query into an embedding and search PostgreSQL pgvector tables by cosine distance, returning ranked document chunks with similarity scores for RAG.

Instructions

Semantic search across a PostgreSQL pgvector table using cosine distance. Takes a natural language query, generates an embedding, and returns the most similar document chunks with similarity scores. Use list_postgres_tables with vector_only=true to discover available pgvector tables. For RAG: pass the returned text to ai_answer.

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": {
      "query": "<query>"
    },
    "name": "search_pgvector"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesNatural language search query
tableNoTable name (default: documents)
top_kNoNumber of results to return (default: 5)
schemaNoPostgreSQL schema (default: public)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It discloses embedding generation, cosine-distance ranking, and return of document chunks with similarity scores, but it omits permissions/auth requirements, failure behavior for missing tables or embedding errors, and limits beyond top_k.

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 sentences are front-loaded with the core operation, followed by discovery guidance and the RAG workflow. Every sentence earns its place and there is no redundant wording.

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?

For a four-parameter search tool with no output schema or annotations, the description explains what is returned and how to discover tables and use results in RAG. It would be more complete with permission and error-handling details, but the core invocation context is present.

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 description coverage is 100%, so the schema already documents all four parameters. The description reinforces that query is natural language and that the tool operates on pgvector tables, but it adds no format or default semantics beyond what the schema provides for table, top_k, and schema.

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

Purpose5/5

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

States a specific action and resource: semantic search across a PostgreSQL pgvector table using cosine distance. It also specifies natural-language query input and returning similar document chunks with similarity scores, which clearly distinguishes it at the PostgreSQL/pgvector resource level from other search_* siblings.

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

Usage Guidelines4/5

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

Gives an explicit discovery step: use list_postgres_tables with vector_only=true to find available pgvector tables. It also states the RAG handoff to ai_answer, though it does not explicitly compare this tool against search_chroma, search_milvus, or other vector-store search tools.

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