Skip to main content
Glama
itsalfredakku

Postgres MCP Server

data

Perform PostgreSQL database operations including insert, update, delete, and bulk data management with validation for table modifications.

Instructions

Data operations: insert, update, delete, bulk operations with validation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction: insert (single row), update (modify rows), delete (remove rows), bulk_insert (multiple rows), bulk_update (batch update), truncate (empty table)
tableNameYesTable name (required for all actions)
schemaNameNoSchema name (default: public)public
dataNoData object for insert/update (key-value pairs)
rowsNoArray of data objects for bulk operations
whereNoWHERE conditions for update/delete operations
optionsNoOperation options

Implementation Reference

  • Handler function that processes calls to the 'data' tool. Currently implemented as a placeholder returning a message that data operations are not yet implemented.
    private async handleData(args: any) {
      // Placeholder for data operations
      return {
        content: [{
          type: 'text',
          text: JSON.stringify({ message: 'Data operations not yet implemented' }, null, 2)
        }]
      };
  • Input schema definition for the 'data' tool, specifying parameters for various data manipulation actions (insert, update, delete, bulk operations, truncate).
    {
      name: 'data',
      description: 'Data operations: insert, update, delete, bulk operations with validation',
      inputSchema: {
        type: 'object',
        properties: {
          action: {
            type: 'string',
            enum: ['insert', 'update', 'delete', 'bulk_insert', 'bulk_update', 'truncate'],
            description: 'Action: insert (single row), update (modify rows), delete (remove rows), bulk_insert (multiple rows), bulk_update (batch update), truncate (empty table)'
          },
          tableName: {
            type: 'string',
            description: 'Table name (required for all actions)'
          },
          schemaName: {
            type: 'string',
            description: 'Schema name (default: public)',
            default: 'public'
          },
          data: {
            type: 'object',
            description: 'Data object for insert/update (key-value pairs)'
          },
          rows: {
            type: 'array',
            items: { type: 'object' },
            description: 'Array of data objects for bulk operations'
          },
          where: {
            type: 'object',
            description: 'WHERE conditions for update/delete operations'
          },
          options: {
            type: 'object',
            properties: {
              onConflict: { type: 'string', description: 'ON CONFLICT action (DO NOTHING, DO UPDATE)' },
              returning: { type: 'array', items: { type: 'string' }, description: 'Columns to return' },
              validate: { type: 'boolean', default: true, description: 'Validate data before operation' }
            },
            description: 'Operation options'
          }
        },
        required: ['action', 'tableName']
      }
    },
  • src/index.ts:634-636 (registration)
    Registration of tool list handler that returns the toolDefinitions array, which includes the 'data' tool schema.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: toolDefinitions,
    }));
  • src/index.ts:655-656 (registration)
    Dispatch/registration of the 'data' tool handler in the CallToolRequestSchema switch statement.
    case 'data':
      return await this.handleData(args);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions validation but doesn't specify what validation entails, error handling, or performance implications. It lists operations but doesn't describe side effects, atomicity, or rollback behavior. For a tool with multiple mutation actions, this leaves significant gaps in understanding how it behaves.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core purpose. It wastes no words but could be slightly more structured by separating operation types from validation. Every element earns its place, though it's borderline terse given the tool's complexity.

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

Completeness2/5

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

Given the tool's high complexity (7 parameters, multiple mutation actions, nested objects) and lack of annotations or output schema, the description is insufficient. It doesn't explain return values, error conditions, or operational constraints. For a multi-action data manipulation tool, this leaves the agent under-informed about critical behavioral aspects.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description adds minimal value beyond the schema by listing operation types, but doesn't provide additional context about parameter interactions or usage patterns. The baseline score of 3 reflects adequate but not enhanced parameter understanding.

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

Purpose4/5

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

The description clearly states the tool performs data operations (insert, update, delete, bulk operations) with validation, which is a specific verb+resource combination. It distinguishes itself from siblings like 'query' or 'tables' by focusing on data manipulation rather than querying or metadata. However, it doesn't explicitly differentiate from all siblings (e.g., 'transactions' might also involve data operations).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose 'data' over 'query' for data retrieval, or how it relates to 'transactions' for atomic operations. There's no context about prerequisites, dependencies, or exclusions, leaving the agent to infer usage from the action list alone.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

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

curl -X GET 'https://glama.ai/api/mcp/v1/servers/itsalfredakku/postgres-mcp'

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