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

MCPg - Production-grade PostgreSQL MCP Server

Full text search

full_text_search
Read-only

Rank documents in a PostgreSQL text column against a full-text query using tsvector/tsquery, with web-search syntax and relevance scores.

Instructions

Rank a text column's documents against a full-text query using PostgreSQL's built-in tsvector/tsquery. The query accepts web-search syntax (quoted phrases, or, - exclusion). Returns a list of objects with the matched row's primary key columns plus rank (ts_rank score, higher = better match).

Example: full_text_search(schema='public', table='articles', column='body', search_query='"new york" OR -draft')

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

Input Schema

NameRequiredDescriptionDefault
limitNo
tableYes
columnYes
configNoenglish
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.
search_queryYes

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.6/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, so safety is covered, and the description goes further by disclosing the return shape (primary key columns plus `rank`) and the meaning of `rank` (ts_rank, higher = better). It omits operational behavior such as how `limit` bounds results or what happens for an unsupported column/config, but the added context is well beyond what the annotations supply.

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

Conciseness4/5

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

Three tight sentences front-load the purpose, then query semantics, then return shape, followed by a worked example. The example earns its place by demonstrating the non-obvious query syntax, though it partly restates parameter names the schema already provides.

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

Completeness3/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 result fields, yet the parameter surface (7 params, 14% coverage) leaves `config` and `limit` behavior unstated. For a search tool whose results and ranking depend on those settings, the definition is adequate but not complete.

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 only 14%, and the description compensates for the most important gap by explaining `search_query` web-search syntax (quoted phrases, `OR`, `-` exclusion) and showing schema/table/column together in an example. It says nothing about `config` (stemming/language, default 'english') or `limit` (default 10, result cap), so two of the seven parameters remain unexplained in both schema and description.

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 gives a specific verb and resource ('Rank a text column's documents against a full-text query') and names the underlying mechanism (PostgreSQL tsvector/tsquery), so the operation is unambiguous. It does not distinguish itself from close siblings such as fuzzy_search, pg_search_run, hybrid_search, or run_select with a text condition, which keeps it out of 5 territory.

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?

Usage is only implied: by naming built-in tsvector/tsquery rather than BM25 or embeddings, it hints at when it applies, and the query-syntax sentence tells the agent what query style is acceptable. There is no explicit when-to-use/when-not guidance or routing to the other search tools (fuzzy_search, vector_search, pg_search_run) that an agent would have to choose between.

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