agr_postgres_mcp
OfficialProvides tools for interacting with PostgreSQL databases, enabling querying, schema inspection, and database administration.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agr_postgres_mcpDescribe the users table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agr_postgres_mcp
MCP server for interacting with PostgreSQL databases via psql. Designed for use with Claude Code as a Model Context Protocol (MCP) server.
Configuration
The server is configured entirely through environment variables:
Variable | Required | Default | Description |
| Yes | — | PostgreSQL hostname |
| No |
| Database username |
| Yes | — | Database password |
| Yes | — | Database name |
| No |
| Database port |
| No |
| MCP server name (used in logs and tool prefixes) |
| No | auto-detect | Full path to the |
If PSQL_PATH is not set, the server searches common locations:
/opt/homebrew/opt/postgresql@15/bin/psql/opt/homebrew/opt/postgresql@13/bin/psql/Applications/Postgres.app/Contents/Versions/15/bin/psql/Applications/Postgres.app/Contents/Versions/14/bin/psql/usr/local/bin/psql/usr/bin/psql
Related MCP server: PostgreSQL MCP Server
Tools
Tool | Description |
| Execute arbitrary SQL with configurable output format (table/csv/expanded) and timeout |
| List all tables in a schema |
| Describe a table's columns, types, constraints, and indexes ( |
| List indexes, optionally filtered by table |
| Show table sizes (data, index, total) sorted by size |
| Show live/dead tuples, last vacuum/analyze times |
| Show active database connections from |
| Show current locks with blocking information |
| Show query execution plan ( |
| Show total database size and object counts |
| Estimated row counts for all tables |
| List foreign key constraints, optionally filtered by table |
| Index scan statistics for identifying unused indexes |
| Search for tables or columns by LIKE pattern |
Setup
npm install
npm run buildMCP Configuration
Add an entry to .mcp.json for each database instance:
{
"mcpServers": {
"pg-alpha": {
"type": "stdio",
"command": "node",
"args": ["/path/to/agr_postgres_mcp/dist/index.js"],
"env": {
"PG_SERVER_NAME": "alpha",
"PG_HOST": "your-db-host.example.com",
"PG_USER": "postgres",
"PG_PASSWORD": "your-password",
"PG_DATABASE": "your-database",
"PSQL_PATH": "/path/to/psql"
}
}
}
}Multiple instances can be configured by adding additional entries with different PG_SERVER_NAME and PG_HOST values.
Available Tools
14 toolsactive_connectionsA
Show active database connections with their state, query, and duration.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. 'Show' implies a non-destructive read operation and the listed fields (state, query, duration) give some sense of the output, but it does not disclose scope (all sessions vs. current user), permission requirements, or whether results are a live snapshot.
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, front-loaded sentence that states the action, the target, and the returned fields without any filler. Every word earns its place, and there is no redundancy with the schema.
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 no-parameter read-only listing tool, the description is largely complete: it names the object and the meaningful output fields. It could be slightly richer by clarifying whether all database connections or only the current session's connections are shown, but it is sufficient for an agent to invoke 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 tool has zero parameters, so the description needs to add little here. The schema is empty and the description does not introduce any phantom filtering options, which is appropriate for a tool that takes no arguments.
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 ('Show') and a clear resource ('active database connections'), and names the exact fields returned: state, query, and duration. Among siblings like locks, query, and table_stats, it is unambiguous which one surfaces live connection information.
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?
There is no guidance on when to use this tool versus alternatives such as locks, query, or table_stats. The context is implied by the name and description, but no exclusions or alternative routing are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
database_sizeA
Show the total database size and individual table sizes.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. 'Show' implies a read-only operation, and the output scope is stated. However, it does not disclose possible performance costs, permission requirements, or whether sizes include indexes/overhead, which would add useful context.
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 concise sentence with no unnecessary words. It front-loads the action and resource, making 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?
For a zero-parameter read-only tool, the description is mostly complete: it tells the agent what to expect (total and per-table sizes). The lack of an output schema leaves minor ambiguity about units and formatting, but this is not critical for such a straightforward operation.
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 tool has zero parameters and the schema shows 100% coverage, so the baseline of 4 applies. The description correctly avoids inventing parameter details, and no further parameter semantics are needed.
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 action ('Show') and a specific resource ('total database size and individual table sizes'), making the purpose understandable. However, it does not explicitly differentiate from the sibling tool 'table_sizes', which likely overlaps on table-level size information.
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?
There is no guidance about when to use this tool versus alternatives like 'table_sizes' or 'list_tables'. The description only states what the tool does, leaving the agent to infer the appropriate context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
describe_tableA
Describe a table's columns, types, constraints, and indexes. Equivalent to psql \d+ command.
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name to describe |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. 'Describe' and the psql \d+ comparison clearly indicate a read-only metadata inspection operation rather than a mutation or query execution. It also sets return expectations by enumerating the output contents, though it does not discuss permissions or missing-table 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?
The description is a single, efficient sentence with no wasted words. It front-loads the core action and object, then adds the useful psql \d+ analogy for extra clarity.
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 one-parameter metadata tool with no annotations and no output schema, the description tells the agent what input is needed and what output to expect. It does not explicitly address schema-qualified table names, but the psql \d+ equivalence and the listed output types are sufficient for confident invocation.
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 already documents the only parameter with 100% coverage ('Table name to describe'), so the description adds no new parameter-level meaning. The tool is simple enough that this baseline is acceptable.
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 ('describe') and the specific resource contents (columns, types, constraints, indexes). The psql \d+ equivalence gives the tool a concrete, recognizable identity. This distinguishes it from sibling tools like query, list_tables, and table_sizes.
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 clear context for when to use the tool: whenever you need a table's full structural metadata, equivalent to psql \d+. It does not explicitly name alternatives or say when not to use this tool, so it falls short of a top score, but the usage intent is immediately clear.
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 execution plan for a SQL query using EXPLAIN. Does not execute the query.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL query to explain | |
| analyze | No | If true, use EXPLAIN ANALYZE to actually run the query and show real timing. Use with caution on production. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full responsibility for behavioral disclosure. It states the tool does not execute the query, but this is contradicted by the analyze parameter, which uses EXPLAIN ANALYZE to actually run the query. The description is misleadingly absolute and does not disclose the execution side effect or production caution; that information is relegated to the parameter schema.
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 short sentences with no wasted words. The core output ('Show the query execution plan') is front-loaded, and the key non-execution property is stated immediately. The structure is tight and scannable.
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 two-parameter tool with no output schema, the definition mostly covers what an agent needs: the operation and the safe default behavior. The analyze mode is documented in the schema, but the main description's unqualified 'Does not execute the query' introduces a completeness gap that would be better qualified with a caveat about analyze=true.
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 100%: both 'sql' and 'analyze' have descriptive comments, including the important execution consequence of 'analyze'. The main description adds no parameter-level detail, but the schema already handles parameter meaning, so a baseline of 3 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 names a specific action and resource: shows the query execution plan using EXPLAIN. It also explicitly states 'Does not execute the query,' which distinguishes it from the sibling 'query' tool and makes the tool's role immediately clear.
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 clearly signals this is for inspecting execution plans, not for running queries. It doesn't explicitly name the alternative sibling, but the phrase 'Does not execute the query' effectively routes an agent away from tools that do execute. The analyze parameter also adds a conditional usage warning about production.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
foreign_keysA
List foreign key constraints, optionally filtered by table.
| Name | Required | Description | Default |
|---|---|---|---|
| table | No | Filter foreign keys for a specific table (optional) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must carry the burden of behavioral disclosure. It does convey that this is a read-only listing operation and that filtering is optional, but it does not disclose output format, ordering, default behavior with no table filter, or any limitations.
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 earns its place, and the core operation is immediately clear.
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 introspection tool with one optional parameter and no output schema, the description is largely sufficient. It does not describe the return shape, but the direct 'List' phrasing and sibling context make the result type reasonably inferable.
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 100%, so the schema already documents the 'table' parameter. The description adds minimal value by restating that filtering is optional, but it does not provide additional semantics such as exact-match behavior or format expectations.
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 ('List') with a specific resource ('foreign key constraints') and notes the optional table filter. This clearly distinguishes it from sibling tools like list_indexes, list_tables, and describe_table.
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 no guidance on when to use this tool versus alternatives such as list_indexes or schema_search. The optional table filter is parameter behavior, not usage context, so an agent gets no help choosing between this and sibling introspection tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
index_usageA
Show index usage statistics to identify unused or rarely used indexes.
| Name | Required | Description | Default |
|---|---|---|---|
| table | No | Filter for a specific table (optional) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description only says 'Show', implying a read-only operation, but with no annotations it carries the full burden of behavioral disclosure. It does not state what metrics are returned, whether statistics are cumulative or reset, or if any special permissions are needed. This is too thin for an agent to understand the tool's behavior beyond the name.
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 no fluff, front-loaded with the action and purpose. Every word contributes to the definition, making it efficient and easy to parse.
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 no output schema and no annotations, the description should explain what the returned statistics look like or how to interpret 'unused' indexes. The phrase 'index usage statistics' is ambiguous about the actual metric names, and there is no guidance on how the output maps to the tool's purpose. This leaves an agent uncertain about what to do with the results.
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 100% coverage for the single parameter 'table' with the description 'Filter for a specific table (optional)'. The description adds no additional parameter detail, but since the schema fully documents it, the baseline score of 3 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 uses a specific verb ('Show') and resource ('index usage statistics') with a clear objective ('to identify unused or rarely used indexes'). This clearly differentiates it from siblings like list_indexes or table_stats, which serve different purposes. The purpose is 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 phrase 'to identify unused or rarely used indexes' provides a concrete use case, telling the agent when this tool is appropriate. It does not explicitly mention alternatives or when not to use it, but the context is clear enough for a single-purpose diagnostic tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_indexesB
List all indexes in the database, optionally filtered by table name.
| Name | Required | Description | Default |
|---|---|---|---|
| table | No | Filter indexes for a specific table (optional) |
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 states that indexes are listed, but does not clarify whether all schemas are included, what information is returned for each index, whether the operation is purely read-only, or how the optional filter behaves. The behavior is largely implied rather than 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, well-formed sentence that front-loads the core action and then adds the optional filter. There is no wasted text, though it could have been more informative without becoming overly verbose.
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 no output schema, the description is minimally viable. However, it does not describe the output format or clarify potential ambiguities like scope (all schemas, current schema, etc.), which leaves some gaps for an agent deciding whether the returned data matches its needs.
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 100%, so the schema already documents the single optional 'table' parameter. The description adds minimal value beyond that, merely restating the optional filter concept without introducing new semantics. Baseline 3 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 uses a specific verb ('List') and resource ('indexes in the database'), with an optional filter. It is clearly distinct from sibling tools like list_tables, describe_table, or index_usage, so an agent can easily understand 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?
No guidance is given about when to use this tool versus alternatives such as index_usage, describe_table, or foreign_keys. The optional table filter is mentioned, but there is no context explaining when this tool is the right choice or when another tool would be more appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_tablesB
List all tables in the database with their schema, name, type, and owner.
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | Schema to list tables from (default: public) | public |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must carry the behavioral burden. It conveys a read-only listing operation and the output fields, but it doesn't clarify the scope semantics ('database' vs. the schema parameter defaulting to public), nor does it state permissions or response format.
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, front-loaded sentence with no filler. Every word contributes to stating the action, scope, and returned fields.
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 list operation, the description plus input schema covers the essentials, but the database-vs-schema ambiguity and lack of sibling differentiation leave meaningful gaps. No output schema exists, so the return attribute list is helpful but not fully contextualized.
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 only parameter, 'schema', has 100% schema coverage with a clear description and default. The tool description adds no parameter-level detail beyond that, so the schema adequately carries the semantic weight.
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 operation (list tables) and the resource (database), with specific returned attributes (schema, name, type, owner). It is distinguishable from siblings like describe_table and list_indexes, though it doesn't explicitly name any alternative.
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?
No guidance is given on when to use this tool versus siblings such as describe_table, schema_search, or table_stats. The agent is left to infer context from the name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
locksA
Show current locks in the database with blocking information.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the behavioral burden. It clearly indicates a non-mutating read operation via 'show' and discloses that the output includes blocking information. It does not mention permissions or output formatting, but for a zero-parameter diagnostic tool this is reasonably transparent.
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. It states the action, the target resource, and the key additional information ('blocking information') efficiently.
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 tool with no parameters, no annotations, and no output schema, the description sufficiently explains what the agent should expect: current locks and blocking details. It is slightly incomplete in not positioning this tool relative to active_connections, but the zero-input nature keeps the gap small.
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 tool has zero parameters and the schema coverage is 100%, so there is nothing for the description to add about parameters. The zero-parameter baseline of 4 applies.
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 ('show'), a clear resource ('current locks in the database'), and a useful qualifier ('with blocking information'). It is distinct from generic siblings like query and active_connections, though it does not explicitly call out a sibling by name.
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 a diagnostic use case—investigating current lock activity and blocking — but it does not state when to prefer this tool over related siblings like active_connections or explain. No exclusions or alternative conditions are given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
queryB
Execute a SQL query against the PostgreSQL database. Returns the query results as text. Use LIMIT clauses on exploratory queries.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL query to execute | |
| format | No | Output format: table (default), csv, or expanded (vertical) | table |
| timeout | No | Query timeout in milliseconds (default: 30000) |
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 mentions that results are returned as text and advises LIMIT usage, but it does not disclose that arbitrary SQL may modify data, that the tool is potentially destructive, or any side effects. This is a significant gap for a general SQL execution 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 two short sentences with no filler. The primary action and database target are front-loaded, and the LIMIT guidance earns its place as a practical safety tip.
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 schema fully documents the parameters and the description covers the return type and exploration advice. However, the lack of any statement about read-only vs. write capabilities leaves the tool incomplete given the potentially destructive nature of arbitrary SQL execution.
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 has 100% description coverage for all three parameters, so the baseline is 3. The description adds no parameter-level meaning beyond mentioning that results are returned as text, which is already implied by the schema's format parameter.
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 executes SQL queries against a PostgreSQL database and returns results as text. It is distinguishable from the schema-inspection siblings (list_tables, describe_table), though it does not explicitly differentiate itself from 'explain' or note whether writes are allowed.
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 one concrete usage tip: 'Use LIMIT clauses on exploratory queries.' However, it does not state when to prefer this tool over alternatives like explain or schema_search, nor does it mention any exclusions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
row_countsA
Show estimated row counts for all tables, sorted by count descending.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of tables to show (default: 50) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses that counts are estimates, which is an important accuracy caveat, and that results are sorted descending. However, it says 'for all tables' while the limit parameter defaults to 50, so the truncation behavior is not disclosed in the description and no annotations are present to fill that 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?
A single sentence with no filler; it conveys the metric, scope, estimation qualifier, and sort order in a compact, front-loaded manner.
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 one-parameter tool with no output schema, the description captures the essential output (estimated row counts) and ordering. The schema documents the limit parameter, so the only notable gap is the 'all tables' wording conflicting with the default limit, which is minor for an introspection tool.
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 only parameter, limit, is already fully described in the input schema ('Number of tables to show (default: 50)'). The description adds no additional parameter semantics, so the baseline of 3 applies due to full 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 ('Show') and clearly identifies the resource ('estimated row counts for all tables') plus the ordering behavior ('sorted by count descending'). It is immediately distinguishable from siblings like table_sizes and table_stats because the metric is explicitly row counts.
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 clear: this tool is for getting a quick overview of table row counts across the database. It does not name alternatives or state when not to use it, but the specificity of the description minimizes confusion with siblings like query or list_tables.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
schema_searchB
Search for tables or columns matching a pattern. Useful for finding tables by name.
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | Search pattern (SQL LIKE pattern, e.g. '%gene%') | |
| search_type | No | Search tables or columns (default: tables) | tables |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden of disclosing behavior. It only implies a read-only search operation and does not mention result size limits, case sensitivity, whether schema-qualified names are supported, or what the output contains. This is a notable gap for an unannotated 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 compact and front-loads the core behavior in the first sentence. The second sentence adds a use case but is somewhat redundant with the first, keeping it from a perfect score.
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 two-parameter search tool, the core usage is clear. However, with no output schema, the description does not explain what the search returns or any limits, so an agent may be unsure about the result format without additional inference.
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 already documents both parameters fully, including the LIKE pattern format and the tables/columns enum with a default. The description adds little beyond 'matching a pattern,' so the baseline score of 3 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 states a specific verb and resource: search for tables or columns matching a pattern. This is clear enough to identify the tool's job, though it does not explicitly differentiate it from siblings like list_tables or describe_table.
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 some guidance by saying it is 'useful for finding tables by name,' which implies a name-based discovery use case. However, it does not explicitly say when to prefer this tool over alternatives such as list_tables, describe_table, or query, and it provides no exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
table_sizesA
Show table sizes including data, indexes, and total. Sorted by total size descending.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of tables to show (default: 20) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It discloses sorting behavior and the inclusion of data/indexes/total, which is useful, but it does not mention whether this is read-only, whether it requires special permissions, whether it includes temporary/metadata tables, or whether it scans all schemas. A read-only report tool without annotations should state safety and scope assumptions.
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?
One concise, information-dense sentence with zero filler. It front-loads the main purpose, specifies scope, and states the sort order.
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 report tool with one optional parameter and no output schema, the description is mostly complete. However, it lacks a note about scope (current database? all schemas?), whether it is safe/read-only, and how the result set behaves with the limit (top N by total? ties?). These gaps are modest 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 description coverage is 100%, so the schema already documents the limit parameter. The description adds the default sorting and what sizes are shown, which gives context for the limit parameter, but there is no extra detail such as whether 0 means unlimited or how limit interacts with the sort. Baseline 3 applies; slight credit for the description reinforcing the sort order that makes limit meaningful.
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?
Description uses specific verb 'Show' with resource 'table sizes' and clarifies it includes data, indexes, and total, sorted by total size descending. This clearly distinguishes it from siblings like database_size, row_counts, and table_stats.
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 a read-only reporting use case and the sibling list includes alternatives like database_size, row_counts, table_stats, but it does not explicitly state when to choose this tool over those alternatives. The sorting and included sizes hint at its purpose, but there is no explicit when/why guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
table_statsA
Show table statistics including live/dead tuples, last vacuum/analyze times.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of tables to show (default: 20) | |
| table | No | Specific table name (optional, shows all if omitted) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses the read-only nature ('Show') and lists specific statistics, which is useful. However, it does not mention any performance implications, default sorting/filtering behavior, or whether it only covers user tables versus system tables, leaving some ambiguity about the exact 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?
A single, front-loaded sentence with no filler. Every word adds value: it names the action, the resource, and two concrete statistics categories. This is an ideal level of conciseness for a simple tool.
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 is simple, has two optional and well-documented parameters, and no output schema. The description adequately conveys the return content at a high level. The main gap is not explicitly stating that this is a safe read-only operation and not specifying the output format, but these are minor for a stats-display tool.
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 100%, so the schema already documents both 'limit' and 'table'. The description adds only a bit of context about the statistics returned, but no parameter-specific meaning beyond the schema. Baseline 3 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 states a specific verb ('Show'), a precise resource ('table statistics'), and the distinctive content ('live/dead tuples, last vacuum/analyze times'). This clearly distinguishes it from sibling tools like 'table_sizes' or 'row_counts' without needing to name them.
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 no guidance on when to use this tool versus the many sibling tools, such as 'table_sizes', 'row_counts', or 'index_usage'. No context, prerequisites, or exclusions are mentioned, leaving the agent to infer usage solely from the name and one-line description.
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.
14 tool updates
v1.0.0- First observed
active_connections - First observed
database_size - First observed
describe_table - First observed
explain - First observed
foreign_keys - First observed
index_usage - First observed
list_indexes - First observed
list_tables - First observed
locks - First observed
query - First observed
row_counts - First observed
schema_search - First observed
table_sizes - First observed
table_stats
TDQS
Most tools target a distinct diagnostic concern such as schema, indexes, locks, or statistics. The main overlap is between database_size and table_sizes, which both report table sizes, but the rest are clearly separable.
All names are snake_case and readable, but conventions are mixed: list_/describe_ prefixes appear on some tools while others use bare nouns like locks and table_sizes or bare verbs like query and explain. This is mostly predictable but not fully consistent.
With 14 tools, the server is well-scoped for PostgreSQL inspection and administration. Each tool covers a meaningful diagnostic or query task without excessive redundancy.
The toolkit provides strong coverage of schema discovery, query analysis, sizes, stats, indexes, and locking. It lacks explicit tools for database objects like views or functions and for write operations, but the generic query tool fills those gaps, so the core diagnostic surface is complete.
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.
Comprehensive PostgreSQL documentation and best practices, including ecosystem tools
Your Supabase account in natural language: run SQL, apply migrations, manage tables, storage, edge f
Connect to PlanetScale databases, branches, schema, query insights, and execute SQL
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables exploration and querying of PostgreSQL databases through natural language. Supports listing tables, viewing schemas, executing SELECT queries, filtering records, and retrieving database statistics.2MIT
- FlicenseNot gradedqualityDmaintenanceEnables interaction with PostgreSQL databases through resources, tools, and prompts for data analysis, including listing tables, executing read-only queries, and generating analysis workflows.-
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to interact deeply with PostgreSQL databases—query data, manage schema, analyze performance, and administer the database.1214MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI models to execute SQL queries, list tables, and describe table structures on a local PostgreSQL database.3-
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/alliance-genome/agr_postgres_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server