Skip to main content
Glama
mittalpk

mcp-server-pgvector

by mittalpk

similarity_search

Retrieve the k nearest neighbors for a query embedding, with optional metadata filters for precise, injection-safe search.

Instructions

Find the k nearest neighbors to a query embedding.

`filters` is a structured allowlist (column/op/value) — not raw SQL — so
metadata filtering stays injection-safe.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNo
tableYes
metricNocosine
schemaNopublic
filtersNo
return_columnsNo
query_embeddingYes
embedding_columnYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does add a valuable security guarantee: 'filters' is a structured allowlist, not raw SQL, and is injection-safe. However, it does not disclose other behavioral traits such as the return format, any potential side effects (though likely read-only), or error/performance characteristics, leaving significant gaps.

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?

The description is exceptionally concise: two sentences, front-loaded with the main purpose and a contextually relevant security note. Every sentence earns its place without redundancy, making it easy to parse and quick to understand.

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

Completeness2/5

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

Despite having an output schema, the tool is complex with 8 parameters and no annotations. The description only addresses the filters safety aspect, leaving out crucial context about metric selection, k behavior, return_columns, and the critical distinction from hybrid_search. It is not complete enough for an agent to confidently select and invoke this tool.

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

Parameters2/5

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

Schema description coverage is 0%, meaning the description adds no parameter names or explanations beyond the schema. The only parameter it touches is 'filters', explaining its structure and safety. For the remaining seven parameters (table, embedding_column, query_embedding, k, metric, schema, return_columns), the description provides no added meaning, which is insufficient given the low coverage and the tool's complexity.

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?

The description opens with a specific and clear action: 'Find the k nearest neighbors to a query embedding.' This effectively conveys the tool's core function with a concrete resource and operation. However, it does not explicitly differentiate it from closely related siblings like hybrid_search or explain_similarity_query, so it misses the top score for distinctiveness.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus the available alternatives. It doesn't mention suitable scenarios, exclusions, or relationships to sibling tools. The existence of hybrid_search and explain_similarity_query suggests meaningful distinctions, but the description leaves them unaddressed.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mittalpk/mcp-server-pgvector'

If you have feedback or need assistance with the MCP directory API, please join our Discord server