Skip to main content
Glama

PostgreSQL MCP Server

AGPL 3.0
438
89
  • Linux
  • Apple

pg_manage_functions

Manage PostgreSQL functions with a single tool to get, create, or drop functions. Specify operation, function name, schema, parameters, return type, and body for precise control and automation.

Instructions

Manage PostgreSQL functions - get, create, or drop functions with a single tool. Examples: operation="get" to list functions, operation="create" with functionName="test_func", parameters="" (empty for no params), returnType="TEXT", functionBody="SELECT 'Hello'"

Input Schema

NameRequiredDescriptionDefault
cascadeNoWhether to include CASCADE clause (for drop operation)
connectionStringNoPostgreSQL connection string (optional)
functionBodyNoFunction body code (required for create operation)
functionNameNoName of the function (required for create/drop, optional for get to filter)
ifExistsNoWhether to include IF EXISTS clause (for drop operation)
languageNoFunction language (defaults to plpgsql for create)
operationYesOperation to perform: get (list/info), create (new function), or drop (remove function)
parametersNoFunction parameters - required for create operation, required for drop when function is overloaded. Use empty string "" for functions with no parameters
replaceNoWhether to replace the function if it exists (for create operation)
returnTypeNoReturn type of the function (required for create operation)
schemaNoSchema name (defaults to public)
securityNoFunction security context (defaults to INVOKER for create)
volatilityNoFunction volatility (defaults to VOLATILE for create)

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "cascade": { "description": "Whether to include CASCADE clause (for drop operation)", "type": "boolean" }, "connectionString": { "description": "PostgreSQL connection string (optional)", "type": "string" }, "functionBody": { "description": "Function body code (required for create operation)", "type": "string" }, "functionName": { "description": "Name of the function (required for create/drop, optional for get to filter)", "type": "string" }, "ifExists": { "description": "Whether to include IF EXISTS clause (for drop operation)", "type": "boolean" }, "language": { "description": "Function language (defaults to plpgsql for create)", "enum": [ "sql", "plpgsql", "plpython3u" ], "type": "string" }, "operation": { "description": "Operation to perform: get (list/info), create (new function), or drop (remove function)", "enum": [ "get", "create", "drop" ], "type": "string" }, "parameters": { "description": "Function parameters - required for create operation, required for drop when function is overloaded. Use empty string \"\" for functions with no parameters", "type": "string" }, "replace": { "description": "Whether to replace the function if it exists (for create operation)", "type": "boolean" }, "returnType": { "description": "Return type of the function (required for create operation)", "type": "string" }, "schema": { "description": "Schema name (defaults to public)", "type": "string" }, "security": { "description": "Function security context (defaults to INVOKER for create)", "enum": [ "INVOKER", "DEFINER" ], "type": "string" }, "volatility": { "description": "Function volatility (defaults to VOLATILE for create)", "enum": [ "VOLATILE", "STABLE", "IMMUTABLE" ], "type": "string" } }, "required": [ "operation" ], "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