Skip to main content
Glama
ChingEnLin
by ChingEnLin

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
SQMCPAL_PG_PORTNoServer port.5432
SQMCPAL_PG_USERNoOverride the login role, if it differs from your UPN.
SQMCPAL_SSLMODENolibpq sslmode.require
SQMCPAL_MAX_LIMITNoHard cap on rows returned by any tool.1000
AZURE_ACCESS_TOKENNoPre-fetched ARM token, for containers without the az CLI.
SQMCPAL_CONNECT_TIMEOUTNoConnection timeout in seconds.15
SQMCPAL_STATEMENT_TIMEOUT_MSNoServer-side query timeout.30000

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
check_authA

Check whether the current Azure credential is valid for Azure Database for PostgreSQL Flexible Server access, and show which PostgreSQL login role it maps to.

Call this first if you suspect an authentication problem.

list_postgres_serversA

List all Azure Database for PostgreSQL Flexible Servers accessible via the current Azure credential (az login / managed identity).

Returns server names, ARM resource IDs, FQDNs, subscriptions, locations and engine versions.

connect_serverA

Connect to a PostgreSQL flexible server by its ARM resource ID.

Resolves the server FQDN and stores it in session context. The password is a short-lived Microsoft Entra token minted from your own Azure login — nothing is stored on disk.

Args: server_id: ARM resource ID of the flexible server (from list_postgres_servers). server_name: Human-readable server name, for display. Defaults to the ARM name. database: Optional default database for subsequent calls. schema: Optional default schema. Defaults to 'public' when unset.

list_databasesA

List all databases on the currently connected PostgreSQL flexible server, with owner, encoding and on-disk size. Azure-managed system databases are hidden.

list_schemasA

List the schemas in a PostgreSQL database with their owner and table count.

Args: database: Database name. Defaults to the session database.

list_tablesA

List tables, views and materialized views in a PostgreSQL database, with estimated row counts and total size.

Args: database: Database name. Defaults to the session database. schema: Optional schema filter. Omit to list every non-system schema.

describe_tableA

Describe a PostgreSQL table: columns with data types, nullability and defaults, plus primary key, indexes and foreign keys.

Use this before writing a query against an unfamiliar table.

Args: table: Table, view or materialized view name. schema: Schema name. Defaults to the session schema, then 'public'. database: Database name. Defaults to the session database.

sample_rowsA

Fetch a handful of rows from a table to see what the data actually looks like.

Equivalent to SELECT * FROM schema.table LIMIT n.

Args: table: Table name. limit: Rows to return (default 10). schema: Schema name. Defaults to the session schema, then 'public'. database: Database name. Defaults to the session database.

run_queryA

Execute a read-only SQL statement against the connected PostgreSQL database.

Only a single SELECT / WITH / TABLE / VALUES / EXPLAIN / SHOW statement is accepted, and it runs inside a READ ONLY transaction that is always rolled back — writes are rejected by PostgreSQL itself.

Example: SELECT status, count(*) FROM public.orders GROUP BY status ORDER BY 2 DESC

Args: sql: A single read-only SQL statement. limit: Max rows to return (default 100). database: Database name. Defaults to the session database.

count_rowsA

Count rows in a PostgreSQL table, optionally filtered by a WHERE clause.

Exact, unlike the estimates from list_tables, and returns no row data.

Args: table: Table name. where: Optional WHERE clause body without the WHERE keyword, e.g. "status = 'active'". schema: Schema name. Defaults to the session schema, then 'public'. database: Database name. Defaults to the session database.

distinct_valuesA

Get the distinct values of a column with their frequencies, most common first.

Useful for understanding enums, categories and cardinality.

Args: table: Table name. column: Column name. where: Optional WHERE clause body without the WHERE keyword. limit: Max distinct values to return (default 100). schema: Schema name. Defaults to the session schema, then 'public'. database: Database name. Defaults to the session database.

show_contextA

Show the current PostgreSQL session context: connected server, database and schema.

set_contextA

Update the active PostgreSQL database and/or schema without reconnecting.

Args: database: Set the active database. Omit to leave unchanged. schema: Set the active schema. Omit to leave unchanged.

clear_contextA

Disconnect from the current PostgreSQL server, close pooled connections and clear session state.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/ChingEnLin/SQMCPaL'

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