database-mcp
database-mcp
SQL MCP сервер для баз данных с настоящей постраничной выдачей результатов на стороне сервера — функция, которой нет ни у одного устоявшегося MCP сервера для баз данных (DBHub ограничивает количество строк, Google's MCP Toolbox возвращает всё, mcp-alchemy обрезает на 4000 символов).
Эталонная реализация для PostgreSQL.
Зачем
Каждый существующий SQL MCP сервер либо обрезает большие результаты, либо сбрасывает их целиком в контекст модели. Спецификация MCP поддерживает пагинацию только для операций list (tools/list), но не для результатов инструментов. database-mcp закрывает этот пробел:
Запрос выполняется один раз как серверный курсор PostgreSQL (
DECLARE/FETCH FORWARD) внутри удерживаемой транзакции.Каждый
fetch(cursor)продолжает ровно с того места, где закончилась последняя страница — без повторного выполнения, без повторного сканированияOFFSET, а снимок MVCC сохраняет результат стабильным даже при конкурентных записях.Страницы ограничены количеством строк (
page_size) и размером в байтах (max_page_bytes); слишком большие ячейки обрезаются с явным маркером.Удерживаемые курсоры ограничены: максимум N одновременных (вытеснение LRU), вытеснение по TTL простоя, плюс
idle_in_transaction_session_timeoutкак серверная страховка. Исчерпанные курсоры закрываются автоматически.
Related MCP server: pgsql-mcp
Профили подключения — управляются ИИ в рантайме
Подключения — это именованные профили, сохраняемые в ~/.config/database-mcp/profiles.json (chmod 600). ИИ может добавлять, изменять, тестировать и удалять их на лету через инструменты — без перезапуска сервера:
profile_add(name, dsn, allow_writes=false, description, make_default, test=true)profile_remove(name)·profile_test(name)·profiles()каждый инструмент запроса принимает необязательный параметр
profile; при его отсутствии используется профиль по умолчанию.
Профили по умолчанию доступны только для чтения (сессионный default_transaction_read_only); запись требует явного профиля с allow_writes=true.
SSH-мост
Профиль может получить доступ к базе данных, доступной только через SSH (классическая схема «Postgres слушает localhost на удалённом хосте»):
profile_add(name="prod", dsn="postgresql://app@dbhost:5432/app",
ssh_host="dbhost")Туннель — это подпроцесс системного
ssh(-N -L, BatchMode, keepalives) — ваш~/.ssh/config, ключи и агент применяются без изменений. Аутентификация должна работать без интерактивного ввода.ssh_remote_host/ssh_remote_portпо умолчанию соответствуют хосту/порту DSN, видимому с SSH-хоста; если хост DSN совпадает с SSH-хостом, по умолчанию используется127.0.0.1(обычный случай).Туннели запускаются лениво, проверяются на каждом использовании и автоматически пересоздаются. Если туннель умирает во время пагинации, его курсоры инвалидируются с понятной ошибкой, а следующий запрос переподключается.
Мультиплексирование (
ControlMaster) явно отключено для туннельных соединений, чтобы время жизни туннеля точно совпадало с временем жизни подпроцесса.
Инструменты
Инструмент | Назначение |
| Выполнить SQL, получить первую страницу + |
| Следующая страница из удерживаемого курсора — без повторного выполнения |
| Закрыть один/все курсоры досрочно |
| Список таблиц/представлений с оценкой строк и размерами |
| Колонки, ограничения, индексы одной таблицы |
| План запроса (опционально |
| Ориентационная карточка: все таблицы + оценка строк + имена колонок одним вызовом |
| Поиск таблиц/колонок/функций по имени или комментарию |
| Статистика колонок из |
| Внешние ключи таблицы, в обе стороны |
| Кратчайший путь по внешним ключам между двумя таблицами как готовая цепочка JOIN |
| Мгновенная оценка планировщика (опционально |
| Действительно случайные строки через |
| Управление подключениями в рантайме |
| Профили, пулы, открытые курсоры, лимиты |
Результаты — компактный JSON: колонки один раз, строки как массивы — примерно вдвое меньше токенов, чем формат «строка-словарь», который используют другие серверы. query также возвращает estimated_rows (оценка планировщика через EXPLAIN), чтобы модель знала, с чем она работает при пагинации.
Установка и запуск
uv pip install -e .
database-mcp --dsn postgresql://user@host:5432/db # registers profile "default"
database-mcp # start empty, add profiles at runtimeРегистрация в Claude Code:
claude mcp add database -- database-mcp --dsn postgresql://user@host:5432/dbОпции: --profiles FILE, --allow-writes, --page-size 50, --max-page-size 500, --max-page-bytes 32000, --max-cell 400, --cursor-ttl 300, --max-cursors 4, --statement-timeout 30, --keepalive 120, --connect-timeout 5. Переменные окружения: DATABASE_MCP_DSN / DATABASE_URL, DATABASE_MCP_PROFILES.
Обработка устаревших соединений
Мёртвые соединения обнаруживаются быстро на каждом уровне, а не зависают:
SSH-туннели:
ServerAliveInterval=--keepalive(по умолчанию 2 мин) сServerAliveCountMax=1— один пропущенный пробный пакет завершает процесс туннеля, который менеджер движка обнаруживает при следующем использовании и лениво пересоздаёт.Соединения с БД: TCP keepalives (
keepalives_idle=--keepalive, пробы каждые 10 с, 3 пропуска) ловят мёртвых пиров за ~30 с — включая закреплённые курсорные соединения вне пула.Проверка при выдаче из пула: каждое выдаваемое соединение проверяется дешёвым round-trip; устаревшее отбрасывается и прозрачно заменяется — вызывающий никогда не видит ошибку. Простаивающие соединения в пуле перерабатываются через
--keepaliveсекунд; попытки подключения завершаются ошибкой через--connect-timeout(по умолчанию 5 с) вместо стандартных ~2 мин TCP.
Тесты
uv pip install -e '.[dev]'
pytest # needs a local PostgreSQL (DBMCP_TEST_DSN to override)Лицензия
MIT
Available Tools
18 toolscloseA
Close an open cursor (or all cursors when no token is given) to free its connection early.
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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 disclose the action's effect (closing a cursor and freeing a connection) and the special case of closing all cursors when no token is given. However, it does not mention idempotency, error handling for invalid or already-closed cursors, or any side effects on the connection. For a simple close operation, this is a moderate gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, tightly written sentence that front-loads the primary action ('Close an open cursor') and then conditions the behavior on the token. Every word adds value—there is no fluff, and the sentence is easily parseable.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple close operation with an output schema present, the description is mostly adequate. However, it does not explain where cursors come from (e.g., that they are likely returned by sibling tools like query or fetch) or whether closing is optional/required. An agent may need to infer that closing is a resource-management step after using a cursor. Given the simplicity, this is a moderate gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 0%, meaning the description must explain the 'cursor' parameter. It only hints at it via 'when no token is given,' but does not clarify what a token is, how it is obtained, or its format. The schema itself defines the parameter as an optional string or null, but without semantic context the agent may not know how to supply a valid value. The description does not sufficiently compensate for the lack of schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Close') and identifies a concrete resource ('open cursor'), clearly distinguishing it from the sibling data-exploration tools (query, fetch, describe, etc.) that are about reading or inspecting data. The purpose is unambiguous: close a cursor to free its connection.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use the tool: to 'free its connection early,' implying you call it after you are done with a cursor. It also specifies the behavior for the optional token ('all cursors when no token is given'). While it doesn't explicitly list alternatives or when-not-to-use, the context is sufficient for an agent to infer the use case, and no exclusions are needed given the tool's focused role.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
countA
Row count, estimate-first: instant planner estimate (no scan), optionally with a WHERE clause; exact=true runs a real count(*) under the statement timeout. Prefer the estimate.
| Name | Required | Description | Default |
|---|---|---|---|
| exact | No | ||
| table | Yes | ||
| where | No | ||
| profile | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavior disclosure. It plainly states the estimate does a no-scan planner estimate, exact runs a real count with a statement timeout, and optionally applies a WHERE clause. This is transparent and informative, though it doesn't mention read-only nature or side effects (likely none).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the core purpose and immediately followed by the key distinction and recommendation. Every word earns its place; no fluff or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple count tool with an output schema, the description covers the essential behavior: estimate vs exact, WHERE clause, and timeout. The only notable gap is the unexplained 'profile' parameter, which may be needed for correct invocation. Overall, an agent can likely proceed without further clarification.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0% for all parameters, so description must compensate. It explains 'exact' and 'where' (mentioning the WHERE clause) but does not clarify 'profile' or 'table' beyond the schema names. The description adds meaning for two of four parameters, leaving the rest undocumented. This is better than nothing but incomplete.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool performs a 'Row count' and distinguishes between estimate and exact modes. It names the verb and resource, though it doesn't explicitly contrast with sibling tools like sample or query. This is above average but lacks the explicit differentiation of the top tier.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly recommends 'Prefer the estimate' and explains when exact mode is appropriate (real count under timeout). However, it does not guide when to choose this tool over siblings like query or sample, or mention any context where counting might not be suitable. The guidance is limited to within-tool options, not tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
describeA
Describe one table: columns with types/nullability/defaults, constraints (PK/FK/unique/check), and indexes.
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| profile | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description bears the full burden of behavioral disclosure. It clearly describes the output content (columns, constraints, indexes), which is useful. However, it does not mention side effects (likely read-only), error conditions, or the meaning of the optional 'profile' parameter, leaving some behavioral aspects undisclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no fluff. It efficiently conveys the purpose and the key output elements, making it easy to scan and understand.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the output schema exists (so return format is predefined), the description covers the core purpose sufficiently. However, it omits clarification of the 'profile' parameter and provides no usage context relative to sibling tools, leaving some gaps in completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It implies 'table' refers to a table name, but it does not explain the 'profile' parameter at all. The description adds no detail beyond the field titles, leaving the optional parameter ambiguous.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it describes a single table, and enumerates exactly what is returned (columns, types, nullability, defaults, constraints, indexes). This distinguishes it from sibling tools like 'tables' (which lists tables) and 'explain' (query execution plans), so an agent can immediately identify its scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The usage context is implied: use when you need table metadata. However, it does not explicitly state when not to use it or mention alternatives such as 'overview' or 'relations' for broader structural overviews. An agent can infer the purpose but lacks explicit routing guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
explainA
Show the query plan (EXPLAIN). Set analyze=true to actually run the statement and get real timings.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| params | No | ||
| analyze | No | ||
| profile | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and it does disclose the key behavioral trait: without analyze, it only shows the plan; with analyze, it executes and returns real timings. This is important and useful. It does not mention side effects or permissions, but for an explain tool, the execution distinction is the most critical behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no filler. The core purpose is front-loaded, and the analyze behavior is stated in a compact second sentence. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is adequate for the core purpose but leaves parameter semantics underspecified. Given that an output schema exists (so the return format is defined elsewhere) and the tool's parameters have simple types, the description is minimally complete. However, the lack of guidance on params and profile is a gap that an agent must resolve by inferring from context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, but it only explains one of four parameters (analyze). The sql parameter is implied but not described, and params and profile are not explained at all. This leaves the agent guessing about how to pass bind parameters or choose a profile.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb 'Show' and resource 'the query plan', and the EXPLAIN hint makes the tool's purpose unmistakable. It differentiates from siblings like 'query' and 'fetch' by implying this produces a plan rather than results.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description makes it clear the primary use is to obtain a query plan, and mentions that analyze=true changes behavior to execute. However, it does not explicitly say when to use this versus alternatives (e.g., 'query' for execution), nor does it list any exclusions. The guidance is implied but not explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
fetchA
Fetch the next page from an open cursor returned by query. No re-execution: rows continue exactly where the last page ended. The cursor auto-closes when exhausted (has_more=false).
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | Yes | ||
| page_size | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses that no re-execution occurs, rows continue exactly where the last page ended, and the cursor auto-closes when exhausted (has_more=false). This is good coverage for a pagination tool, though it does not address error handling or invalid cursors.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences with high information density, front-loaded with the purpose. Every sentence adds value, no fluff or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The output schema covers return values, so the description rightly focuses on usage. It covers continuation, no re-execution, and auto-close, which are the key behaviors for a pagination tool. Minor gaps like error cases are acceptable given the tool's simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate for undocumented parameters. It only references 'cursor' implicitly ('open cursor'), but never explains it or mentions 'page_size' at all. The agent gets no help on these parameters beyond their names in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Fetch the next page'), the resource ('an open cursor'), and implies its role in pagination by referencing 'returned by query' and 'where the last page ended.' It is specific and distinct from siblings like query or close.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly indicates when to use the tool (when you have a cursor and want the next page) and notes that the cursor auto-closes, so no manual close is needed. It does not explicitly state that query is for the initial fetch, but this is strongly implied by 'returned by query.'
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
join_pathB
Shortest foreign-key path between two tables, rendered as a ready-to-use JOIN chain (up to 3 equally short paths). Use this instead of guessing joins on unfamiliar schemas.
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | ||
| max_hops | No | ||
| to_table | Yes | ||
| from_table | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the burden of behavioral disclosure. It mentions output characteristics (up to 3 equally short paths, ready-to-use chain) but does not state whether the operation is read-only, whether it requires specific permissions, or how errors are handled (e.g., no path found). This is a significant gap for a tool with no annotation safety net.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, with two sentences front-loading the primary purpose. The guidance sentence is useful, though slightly vague. It is efficient and wastes no words, but it could be more structured by separating purpose and usage.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having an output schema, the description leaves key aspects unexplained: the meaning of 'profile' and 'max_hops', and the behavior when no path exists. For a tool with four parameters and no annotations, the description is incomplete and would force an agent to infer critical details.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description only implicitly explains the two required parameters (from_table, to_table) through 'between two tables.' It completely omits the semantics of 'profile' and 'max_hops', which are not documented elsewhere. The description adds minimal value beyond what the schema names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: finding the shortest foreign-key path between two tables and rendering it as a ready-to-use JOIN chain. It distinguishes the tool from ad-hoc guessing but does not explicitly name sibling tools like 'relations' or 'describe', so it falls slightly short of full differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides a clear usage context: 'Use this instead of guessing joins on unfamiliar schemas.' It implies the tool is for unfamiliar schemas and suggests it replaces manual guessing, but it does not explicitly list alternatives or exclusions, so it lacks the full 'when-not-to-use' guidance for a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
overviewA
Orientation card for an unknown database: every table with row estimate and its column names in ONE compact call — use this before tables/describe round-trips. Optional table-name filter.
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | ||
| profile | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of disclosing behavior. It does add meaning by revealing that the call returns row estimates and column names, and emphasizes it is a single compact call. However, it does not mention side effects (likely read-only), any requirements like authentication, or what happens when the filter matches nothing. These are not necessarily critical for an overview tool, and an output schema exists, so a 3 is appropriate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the tool's purpose and value proposition. It wastes no words and includes a clear recommendation for usage. Structure is exemplary for a concise definition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, which presumably describes the return structure, so the description does not need to detail that. However, the description omits any explanation of the 'profile' parameter and does not mention edge cases or requirements beyond the basic filter. For a fairly simple tool with two optional parameters and a comprehensive output schema, this is adequate but not fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must explain parameters. It explicitly covers 'filter' by mentioning the optional table-name filter, but the 'profile' parameter is entirely unexplained. Since profile is an additional optional parameter with no clarification, the description partially compensates but leaves a meaningful gap for one of the two parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the tool's purpose clearly: 'Orientation card for an unknown database: every table with row estimate and its column names in ONE compact call.' It names the specific resource (database tables) and the delivered content (row estimate and column names), and it explicitly differentiates from siblings by saying to use this before tables/describe round-trips. An agent can immediately tell what this tool does and how it differs from the detailed query tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives explicit usage guidance: 'use this before tables/describe round-trips' clearly says when to invoke this tool in a workflow. It also mentions the optional table-name filter, implying a typical use case for filtering. This outperforms many tools that leave usage timing implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
profileA
Column statistics from pg_stats WITHOUT touching the table: null fraction, distinct count (negative = fraction of rows, -1 = unique), most common values with frequencies, histogram bounds, physical correlation. Replaces exploratory SELECT DISTINCT / GROUP BY scans.
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| profile | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full behavioral burden. It clearly states the tool does not touch the table (read-only) and explains the negative distinct count semantics (-1 = unique). It does not mention prerequisites like permissions or staleness of pg_stats, but the behavioral core is well disclosed. This goes beyond a bare statement.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two dense sentences, no fluff, and the primary purpose is front-loaded. The parenthetical clarification on distinct count is efficient and useful. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The output schema exists, so return format is covered. However, parameter semantics are entirely missing, and usage guidance lacks exclusions or mentions of related profile-manipulation tools. Given the tool's moderate complexity, this is an adequate but incomplete definition.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description provides no explanation of the two parameters. 'table' is obvious but 'profile' is unexplained (what it does, why optional, default null). Since the schema carries no descriptions, the description should compensate, but it does not. This is a significant gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action (retrieve column statistics) and the resource (pg_stats) without touching the table, and enumerates exact data points (null fraction, distinct count, MCV, histogram, correlation). It clearly distinguishes itself from generic query/describe tools by emphasizing the read-only, stats-focused purpose and explicitly replaces exploratory SELECT DISTINCT/GROUP BY scans.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives a clear use case: replacing exploratory scans for column statistics. However, it does not explicitly state when not to use it or name sibling alternatives like describe or profile_add/remove. The context is clear but exclusions are absent, so a 4 is appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
profile_addA
Add or update a named connection profile at runtime and persist it. Tests the connection first (set test=false to skip). Profiles are read-only unless allow_writes=true. make_default=true switches the default profile. For a database only reachable via SSH, set ssh_host (an ssh destination or ~/.ssh/config alias; BatchMode, so keys/agent must work non-interactively) — a tunnel is opened automatically and kept alive; ssh_remote_host/ssh_remote_port default to the DSN's host/port as seen FROM the ssh host (usually 127.0.0.1:5432).
| Name | Required | Description | Default |
|---|---|---|---|
| dsn | Yes | ||
| name | Yes | ||
| test | No | ||
| ssh_host | No | ||
| description | No | ||
| allow_writes | No | ||
| make_default | No | ||
| ssh_remote_host | No | ||
| ssh_remote_port | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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, and it excels: it details persistence, connection testing, read-only default, default-profile switching, SSH tunnel auto-open and keep-alive, BatchMode non-interactive requirements, and remote host/port defaults. This is far more transparent than typical tool descriptions, fully informing the agent of side effects and prerequisites.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is moderately long but information-dense. It is front-loaded with the core purpose, then logically progresses to test, write permissions, default switching, and SSH handling. Every sentence adds value, though the SSH paragraph is dense and could be split for readability. No redundant or filler content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has an output schema, so return values need no description. All critical behavioral aspects—persistence, testing, permissions, default switching, and SSH tunneling—are covered. The description fully equips an agent to call the tool correctly, including the non-obvious SSH default resolution. Nothing essential is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description is the only source for parameter meaning. It explains test, allow_writes, make_default, ssh_host, ssh_remote_host, and ssh_remote_port, covering 6 of 9 parameters. The required parameters name and dsn are left implied, but their purpose is self-evident from the tool's function. It does not describe the 'description' parameter, but overall it compensates well for the schema gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description begins with a precise action: 'Add or update a named connection profile at runtime and persist it.' This clearly identifies the verb, resource, and scope, distinguishing it from sibling profile tools like profile_remove and profile_test. It goes beyond a mere name repetition to explain the persistence and test behavior, making the purpose unmistakable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool (adding/updating profiles) and gives specific conditions like 'set test=false to skip' and SSH scenarios, but it never explicitly contrasts with alternatives such as profile_remove or profile_test. There is no explicit when-not-to-use guidance, leaving some inference to the agent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
profile_removeB
Remove a connection profile (open cursors on it are closed).
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully disclose behavioral traits. It mentions that open cursors are closed, which is useful, but it omits critical details for a destructive operation: permanence of removal, error behavior when the profile does not exist, or any permission requirements. The coverage is incomplete.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler. Every word adds meaning, and the additional detail about cursor closure is placed in parentheses, preserving readability. It is appropriately sized for a simple operation.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity and the presence of an output schema (which may describe return values), the description covers the core action and one side effect. However, it does not clarify the exact meaning of the 'name' parameter, error conditions, or any prerequisites, leaving gaps for an agent that must call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides only the parameter name 'name' with a string type and no description (0% coverage). The tool description does not mention the parameter at all, forcing the agent to infer that 'name' refers to the profile name. This is a minimal, non-explicit connection, leaving room for misinterpretation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear verb ('Remove') and a specific resource ('a connection profile'), which immediately distinguishes it from sibling tools like profile_add, profile_test, and profiles. The parenthetical about open cursors adds a unique detail that further clarifies the tool's specific function.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The purpose implies when to use it (when a profile must be removed), but there is no explicit mention of alternatives or exclusions. Since no other sibling tool performs removal, the usage context is clear by inference, but the description does not explicitly state when not to use it or any prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
profilesA
List all connection profiles (DSNs password-redacted) and which one is the default.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses that DSNs are password-redacted and that the default profile is indicated, which are useful behavioral traits. It implicitly signals a read-only operation via 'List', but does not explicitly state that no modifications occur. This is better than many descriptions but could be more explicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single concise sentence that front-loads the action and includes key details without any fluff. Every word earns its place, and the structure is ideal for quick parsing.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter listing tool with an output schema present, the description is fully sufficient. It covers what is listed and notable features (redaction, default). No additional context is needed for an agent to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
This tool takes no parameters, so the baseline is 4 per the rubric. The description does not need to explain parameters, and the 100% schema coverage (trivially) ensures no ambiguity. The description adds no parameter-related info, which is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'List', the resource 'connection profiles', and adds meaningful details: password redaction and default profile indicator. It distinguishes itself from singular 'profile' and mutation tools like 'profile_add' by implying a listing operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use it (when you need to list all profiles), but it does not explicitly contrast with alternatives such as 'profile' (singular) which likely retrieves a single profile. No exclusions or explicit when-not-to-use guidance is given, making it adequate but not exemplary.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
profile_testA
Test connectivity of a profile (default profile when omitted): server version and connect latency.
| Name | Required | Description | Default |
|---|---|---|---|
| name | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears the full burden of disclosing behavior. It states the action and output, but does not mention that it is read-only, non-destructive, or safe to run. For a connectivity test, this is likely an expected safety profile, but it is not stated, leaving ambiguity about side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-constructed sentence that front-loads the primary action and outcome. There is no fluff or redundant information; every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one optional parameter and an output schema, the description covers the essential purpose and result (server version and latency). It doesn't detail failure modes, but the output schema likely covers that. It is sufficiently complete for an agent to know what to expect.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description must clarify the parameter. It explicitly says 'profile (default profile when omitted)', which explains the meaning of 'name' and its default behavior. This adds substantive semantics beyond the schema's bare type and default.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Test connectivity') and resource ('a profile'), and clarifies the default when omitted. It names the observable outcome (server version and connect latency), which clearly distinguishes it from siblings like 'status' or 'profiles'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides context on the default profile but gives no guidance on when to use this tool versus alternatives such as 'status' or 'profiles'. There are no explicit when-to-use or when-not-to-use instructions, leaving the agent to infer its purpose.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
queryA
Execute SQL on a profile (default profile when omitted). Returns the first page as compact {"columns":[...],"rows":[[...],...],"page":{"returned","has_more","estimated_rows","cursor"}}. When has_more is true, pass page.cursor to the fetch tool — the query is NOT re-executed; a server-side cursor is held open (stable snapshot). Placeholders: %s positional with the params array.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| params | No | ||
| profile | No | ||
| page_size | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses the first-page return format, the has_more flag, the server-side cursor held open with a stable snapshot, and the placeholder convention. This goes beyond the schema and gives the agent essential behavioral knowledge. It omits details on permissions or error handling, but for a query tool the core behaviors are covered.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient paragraph that front-loads the purpose, then explains pagination and placeholders in logical order. Every sentence adds value with no redundancy, and the structure makes it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the key behavioral aspects: pagination, cursor semantics, placeholders, and default profile. The output schema exists, so return-value details are not needed. However, it omits page_size entirely and does not provide guidance on SQL limitations or when to use this tool versus siblings. Given the complexity of 4 parameters and no annotations, this is a notable but not critical gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage, so the description must compensate. It explains sql implicitly as the query text, params as the positional %s placeholders, and profile via the 'default profile' mention. However, page_size is completely undocumented in both the schema and the description, leaving its purpose and usage unclear. This is a significant gap for a four-parameter tool.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states 'Execute SQL on a profile', making the verb and resource clear. It also explains the default profile behavior and the pagination mechanism, which distinguishes this from sibling tools like tables or describe by focusing on arbitrary SQL execution. This gives the agent a precise understanding of the tool's role.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context on using the default profile and explicitly instructs to pass the cursor to the fetch tool when has_more is true, establishing a clear pagination workflow. However, it does not explicitly differentiate when to use this tool versus alternatives like explain or count, nor does it state any exclusions. Still, the pagination guidance is a strong usage cue.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
relationsA
Foreign keys of one table, both directions: what it references and what references it.
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| profile | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full responsibility. It discloses the core behavior (both directions of foreign keys) but does not mention read-only nature, potential errors, or any limitations. It adds some behavioral context but not exhaustive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, focused sentence with no fluff. It front-loads the purpose and immediately explains the bidirectional nature. Efficient and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, the description needn't detail return values. It covers the essential behavior and scope. Minor gaps exist: no mention of read-only semantics or profile behavior, but for a simple relational tool this is reasonably complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It clarifies the 'table' parameter (one table) but says nothing about the optional 'profile' parameter. This partial coverage leaves room for confusion about how profile affects results.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: it retrieves foreign keys of a table, in both directions (referenced and referencing). This is specific and distinguishes it from siblings like 'describe' or 'overview' which likely provide broader table metadata.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for exploring foreign key relationships but does not explicitly state when to use this tool over alternatives, nor does it mention any exclusions or prerequisites. It lacks clear routing guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sampleA
A few genuinely random rows from a table (TABLESAMPLE on big tables — no scan, no physically-adjacent LIMIT bias).
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | ||
| table | Yes | ||
| profile | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must cover behavioral traits. It does disclose a key behavior: genuine randomness via TABLESAMPLE, avoiding physical adjacency bias. But it does not explicitly state read-only status, potential errors, or performance implications beyond 'no scan'. The description is honest about the sampling method but lacks completeness on edge cases or side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with a parenthetical, extremely concise and front-loaded with the core purpose. Every word adds value: 'genuinely random rows' sets expectations, and the parenthetical explains the implementation without unnecessary detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Although an output schema is present (so return structure need not be described), the description lacks guidance on when to use this tool versus siblings, does not explain the profile parameter, and does not mention any prerequisites or limitations (e.g., table size). It covers the core purpose but leaves an agent to infer important usage context, especially for non-default parameters.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage, so the description must explain parameters. It hints at n with 'a few' (though n defaults to 5), but does not define n, table, or profile explicitly. The profile parameter, which is nullable, is entirely unaddressed. The description adds minimal value over the schema's structure.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states what the tool does: 'A few genuinely random rows from a table'. It specifies the verb (sample) and resource (table), and adds unique context by mentioning TABLESAMPLE and the avoidance of scan and LIMIT bias. This distinguishes it from generic query/fetch tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool (when you need random rows), and the parenthetical about TABLESAMPLE and no scan suggests it's better than a plain LIMIT for randomness. However, it does not explicitly name alternative tools or state when NOT to use it, leaving the agent to infer the appropriate context from the description alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_objectsB
Find tables, columns, and functions by name OR by comment (pg_description — often the only documentation a schema has). Answers 'where is the customer email?' in one call.
| Name | Required | Description | Default |
|---|---|---|---|
| term | Yes | ||
| limit | No | ||
| profile | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It only states that it finds objects by name or comment, but does not disclose whether it is read-only, what happens with the limit parameter, how results are returned, or any permission/rate considerations. This is a significant behavioral gap for an unannotated search tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with zero waste. The core action is front-loaded, and the example adds immediate value without redundancy. Perfectly sized for a search tool description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is an output schema, so return format is structurally covered, but with no annotations and three parameters, the description should explain parameter interactions (e.g., does profile affect results?), how limit works, and any ordering or matching behavior. It also omits edge cases like case sensitivity or wildcard support. The agent cannot call this tool confidently without further probing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate. It implicitly explains 'term' via the search context, but gives no guidance on 'limit' (does it paginate? is it a max?) or 'profile' (does it filter by profile? optional?). These gaps are critical because the schema provides no descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Find') and names the exact resources (tables, columns, functions) and search criteria (name or comment). The example 'where is the customer email?' provides a concrete, memorable use case that clarifies intent and distinguishes it from generic 'search' tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The example implies a usage context (schema discovery), but the description does not explicitly contrast with sibling tools like query, describe, or explain, nor does it state when not to use it. There is no mention of alternatives or prerequisites, leaving the agent to infer when this tool is preferred.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
statusA
Server status: profiles with pool statistics, open cursors, configured limits, profiles file location.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears the full burden of behavioral disclosure. It does list the content of the status (pool statistics, open cursors, limits, file location), but it does not explicitly state that the operation is read-only, has no side effects, or require any authentication. The nature of a status tool implies safety, but that is not explicitly disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core concept ('Server status') and enumerates the key details concisely. Every word adds value, with no filler or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a status tool with no parameters and an output schema (as indicated by context signals), the description is sufficient to convey what the tool returns. It does not mention potential caveats like error conditions or interpretation of results, but the output schema likely covers that, and the task is simple enough that the description provides adequate context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema is empty with zero parameters, so there is nothing for the description to explain. Per the rubric, a tool with 0 parameters earns a baseline score of 4, and the description adds no unnecessary parameter information.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific resource ('Server status') and lists concrete items it covers: profiles with pool statistics, open cursors, configured limits, profiles file location. This clearly indicates what the tool does and distinguishes it from related siblings like 'profiles' or 'profile' which likely focus on individual profile data rather than overall status.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies its use for retrieving server status through the phrase 'Server status', but it does not explicitly state when to prefer it over alternatives like 'overview' or 'profiles'. There are no exclusions or comparisons with sibling tools, leaving the decision to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tablesA
List tables/views/matviews with estimated row counts and sizes (system schemas excluded). Optional name filter.
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | ||
| profile | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It clarifies that it lists estimated row counts and sizes, and that system schemas are excluded, which are behavioral nuances. It implies a read-only operation by saying 'list', but doesn't explicitly state it has no side effects. This is transparent enough for a listing tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core purpose, then adds the exclusion and filter details. No wasted words; every clause adds useful information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The output schema is present, so return values need no explanation. However, the description doesn't explain the 'profile' parameter, and it doesn't provide guidance on when to use this tool versus siblings. For a simple listing tool with an output schema, it's mostly complete but those gaps prevent a higher score.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It explains 'filter' as an optional name filter but gives no details on format or allowed values. The 'profile' parameter is not mentioned at all, leaving the agent uninformed about how to use or pass it. This is a significant gap for a two-parameter tool.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: listing tables/views/matviews with estimated row counts and sizes, while excluding system schemas. It also mentions an optional name filter, which distinguishes it from sibling tools like 'search_objects' and 'describe' that have different scopes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives context about what is included (tables/views/matviews) and excludes (system schemas), which implies when it's useful, but it doesn't explicitly state when to choose this tool over alternatives or any exclusions. Since siblings like 'search_objects' and 'describe' exist, more explicit routing guidance would be helpful.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
18 tool updates
v0.4.0- First observed
close - First observed
count - First observed
describe - First observed
explain - First observed
fetch - First observed
join_path - First observed
overview - First observed
profile - First observed
profile_add - First observed
profile_remove - First observed
profile_test - First observed
profiles - First observed
query - First observed
relations - First observed
sample - First observed
search_objects - First observed
status - First observed
tables
TDQS
Each tool targets a distinct concern: cursor-paginated queries (query/fetch/close), schema exploration (tables/describe/overview/search_objects), statistical analysis (profile/count/sample/relations/join_path), explain plans, and connection profile management (profiles/profile_add/profile_remove/profile_test). No overlapping responsibilities that would cause an agent to misselect.
Tool names are mostly snake_case verbs or nouns that clearly map to actions (query, fetch, describe, count) or objects (tables, profiles). The profile_add/profile_remove/profile_test trio uses a consistent prefix. The only minor inconsistency is mixing singular nouns like 'profile' with plural 'profiles' and standalone verbs, but this does not impair predictability.
At 18 tools, the set is slightly heavy but each tool earns its place—covering query execution, pagination, schema discovery, row sampling, join pathing, explain, column statistics, and connection management. It leans toward the upper bound of reasonable scope for a database MCP server, but avoids bloat.
The tool surface covers the full read-side lifecycle: discover schema (overview, tables, describe, search_objects), analyze data (profile, count, sample, relations, join_path), execute and paginate queries (query, fetch, close), inspect performance (explain), and manage connections (profiles, profile_add/remove/test, status). No critical operations are missing for the intended read/diagnostics purpose.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Connect to PlanetScale databases, branches, schema, query insights, and execute SQL
Generate, fix, explain and run read-only SQL on PostgreSQL, MySQL and SQL Server
1Comprehensive PostgreSQL documentation and best practices, including ecosystem tools
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables comprehensive PostgreSQL database management including index tuning, query plan analysis, health monitoring, schema-aware SQL generation, and safe SQL execution with configurable access control for both development and production environments.9MIT
- AlicenseBqualityBmaintenanceEnables interaction with PostgreSQL databases through comprehensive database management tools including index tuning, query execution plans, health checks, schema intelligence, and safe SQL execution with configurable read-only mode for production use.35MIT
- FlicenseNot gradedqualityBmaintenanceEnables querying PostgreSQL databases via MCP, with multi-database routing, credential isolation, and truncated results plus full CSV export.-
- FlicenseNot gradedqualityCmaintenanceEnables read-only SQL queries and schema inspection for PostgreSQL databases with up to 3 named connections.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/thhart/database-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server