Skip to main content
Glama

PostgreSQL MCP Server

AGPL 3.0
582
99
  • Linux
  • Apple

pg_execute_mutation

Execute PostgreSQL data modifications (INSERT, UPDATE, DELETE, UPSERT) directly by specifying table, operation, and data. Supports WHERE clauses, conflict resolution, and returning modified rows for efficient data management.

Instructions

Execute data modification operations (INSERT/UPDATE/DELETE/UPSERT) - operation="insert/update/delete/upsert" with table and data. Examples: operation="insert", table="users", data={"name":"John","email":"john@example.com"}

Input Schema

NameRequiredDescriptionDefault
conflictColumnsNoColumns for conflict resolution in upsert (ON CONFLICT)
connectionStringNoPostgreSQL connection string (optional)
dataNoData object with column-value pairs (required for insert/update/upsert)
operationYesMutation operation: insert (add rows), update (modify rows), delete (remove rows), upsert (insert or update)
returningNoRETURNING clause to get back inserted/updated data
schemaNoSchema name (defaults to public)public
tableYesTable name for the operation
whereNoWHERE clause for update/delete operations (without WHERE keyword)

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "conflictColumns": { "description": "Columns for conflict resolution in upsert (ON CONFLICT)", "items": { "type": "string" }, "type": "array" }, "connectionString": { "description": "PostgreSQL connection string (optional)", "type": "string" }, "data": { "additionalProperties": {}, "description": "Data object with column-value pairs (required for insert/update/upsert)", "type": "object" }, "operation": { "description": "Mutation operation: insert (add rows), update (modify rows), delete (remove rows), upsert (insert or update)", "enum": [ "insert", "update", "delete", "upsert" ], "type": "string" }, "returning": { "description": "RETURNING clause to get back inserted/updated data", "type": "string" }, "schema": { "default": "public", "description": "Schema name (defaults to public)", "type": "string" }, "table": { "description": "Table name for the operation", "type": "string" }, "where": { "description": "WHERE clause for update/delete operations (without WHERE keyword)", "type": "string" } }, "required": [ "operation", "table" ], "type": "object" }

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/HenkDz/postgresql-mcp-server'

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