Skip to main content
Glama
postgresai

postgresai

Official

deploy_monitoring

Put a PostgreSQL database under PostgresAI Cloud monitoring: provisions the monitoring box, prepares the role, handles IP/PrivateLink access, and returns status, links, and the next action.

Instructions

Put a Postgres database under PostgresAI Cloud monitoring (same as pgai mon deploy): prepares the monitoring role (an admin URL creates it; otherwise returns the SQL), provisions the monitoring box, and returns JSON with status (ready | in_progress | deleting | deleted | inactive | action_required | failed: the same words as pgai dblab deploy), health_url (the project's Health Matrix in the console), dashboard_url (Grafana, signing in with PostgresAI) and next (the exact next action). A billed box is provisioned only with yes: true: without it the result is action_required with the price (and requires_payment_method), so show the price to the user first. It does not wait for the box: call it again to see the status. Safe to call again. When PostgresAI can't reach the database the way an IP allowlist refuses (or with ip_first), the box's IP is reserved first and the result is action_required with step allow_ip (ip, cidr, host, port, reserved_until): give the user the cidr and port to allow on the database, then call again with ip_allowed: true. ClickHouse Managed Postgres, RDS and Supabase are detected from the host. An RDS instance that is not publicly accessible is monitored over AWS PrivateLink (no public IP, nothing opened): the user creates a CloudFormation stack in their AWS account from a link. Until the stack exists the result is action_required with step privatelink_stack and cfn_url: give the user the link to open in the RDS's AWS account (the stack keeps its name); once they say it is created, call again. When this machine's aws CLI can read the RDS (read-only; aws_profile picks the profile, no_aws: true skips it), the link is filled in and the stack is found by itself; otherwise pass vpce_service, the stack's VpceServiceName output. When the URL's user can't create the monitoring role, or this machine can't reach the database (a private RDS seen from outside its VPC), the result is action_required with step prepare_db, sql, nonce and monitoring_password: the user runs the SQL as the master user in that database, then call again with monitoring_password and nonce. host_stats: true adds host CPU, memory, disk and IOPS through a read-only role the stack creates (host_stats_role: its HostStatsRoleArn output, when not read from AWS). Aurora and RDS Proxy endpoints are not supported over PrivateLink. Supabase needs no password (PostgresAI prepares the database through the Supabase Management API): the first time, the result is action_required with a consent link in next; give it to the user to open and approve, then call again. Elsewhere the URL must carry its password, and only these query parameters: sslmode, channel_binding, application_name. PGAI_MON_PASSWORD, PGPASSWORD and CLICKHOUSE_KEY_ID + CLICKHOUSE_KEY_SECRET of the server process are not used (pass clickhouse_key), and a TLS failure is not retried in plaintext (say sslmode=disable for a server without TLS). For another database on a server PostgresAI already monitors for the org, an admin URL with sslmode=require (or verify-*), each query parameter once, is enough: PostgresAI fills in the password of postgres_ai_mon it keeps, over TLS only (on a server without TLS, pass the postgres_ai_mon URL; if nobody has its password, the user runs in a terminal: pgai mon instances delete the server's other databases, then pgai mon deploy --reset-password with PGAI_MON_PASSWORD set to a new one, then deploys them again with it).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "database_url": "<database_url>"
    },
    "name": "deploy_monitoring"
  }
}

Input Schema

NameRequiredDescriptionDefault
yesNoDeploy: accept where the box runs and its price. Without it no box is provisioned, free or billed (on a platform without cloud choice, only a billed one waits for it): the result has status action_required with cloud, location, location_reason_text, price and choices (each cloud's locations); show them to the user, then call again with yes: true (and cloud/location if they chose another place)
cloudNoWhere the monitoring box runs: aws or hetzner (default: the database's cloud, else the platform's default). One of the result's choices
debugNoEnable verbose debug logs
nonceNoRDS over PrivateLink: the nonce of that prepare_db result
vcpusNovCPUs of the database server. Without it there is no AAS (database load) data for this database: ask the user for it
couponNoStripe promotion code for the organization's monitoring subscription (applies when it is first created)
no_awsNoRDS: do not use the aws CLI on this machine
org_idNoOrganization ID. Optional with a per-organization token (uses the stored org); REQUIRED with a global token, which can reach every organization the user belongs to and will not assume one. Use orgs_list / `pgai orgs` to discover valid values.
ip_firstNoReserve the monitoring box's IP and stop before the box (even when PostgresAI can reach the database), so the user can allow it on the database first. The result is action_required with step allow_ip: ip, cidr, host, port, reserved_until
locationNoA location of that cloud, from the result's choices (default: the database's region, else the cloud's default)
providerNogeneric (direct PostgreSQL URL; alias: self-managed) | clickhouse | rds | supabase (default: detected from the host)
terraformNoRDS over PrivateLink: write the stack as a Terraform module (in the current directory) instead of the CloudFormation link
host_statsNoRDS over PrivateLink: also host CPU, memory, disk and IOPS, through a read-only role the stack creates in the user's account
ip_allowedNoThe database now allows the reserved IP (a previous result's step allow_ip): create the box with it. Give the user the cidr and port to allow first, and call with ip_allowed: true only once they confirm
aws_profileNoRDS: the aws CLI profile that reads the RDS and its stack (read-only); default: the aws CLI's own (AWS_PROFILE, default, the instance role)
privatelinkNoRDS: true monitors it over AWS PrivateLink (it is not publicly accessible), false directly (it is). Default: decided from AWS or public DNS; asked (action_required) when neither tells
database_urlYespostgresql:// URL with the password in it (admin, or the postgres_ai_mon role)
vpce_serviceNoRDS over PrivateLink: the stack's VpceServiceName output (com.amazonaws.vpce.<region>.vpce-svc-<id>), from the user, after step privatelink_stack
clickhouse_keyNoClickHouse Cloud API key as <key-id>:<key-secret> (Basic Service API Reader), for CPU, memory and disk
host_stats_roleNoRDS over PrivateLink with host_stats: the stack's HostStatsRoleArn output, when it is not read from AWS
monitoring_userNoMonitoring role to create or use (default postgres_ai_mon). A custom role always carries its own password: PostgresAI keeps only postgres_ai_mon's, so pass the role's own URL as database_url (an admin URL creates only postgres_ai_mon). Not for Supabase, where PostgresAI creates postgres_ai_mon, nor for a private RDS over AWS PrivateLink
monitoring_passwordNoRDS over PrivateLink: the monitoring_password of a prepare_db result whose SQL the user ran (with nonce)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: it discloses that billing requires yes:true, that the call is non-blocking and idempotent ('Safe to call again'), the exact status vocabulary, that env vars like PGAI_MON_PASSWORD are deliberately not used, and that TLS failures are not retried in plaintext. It also documents the PrivateLink, Supabase-consent, and IP-allowlist side effects and who must act in each case.

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

Conciseness3/5

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

The purpose and return shape are front-loaded, and nearly every sentence conveys distinct operational information, but the whole thing is a single unstructured run-on paragraph of several hundred words covering eight separate conditional flows. It is dense enough that an agent or reader will struggle to locate the branch relevant to the current call, and some clauses restate the same action_required mechanic.

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

Completeness5/5

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

For a 22-parameter tool with no output schema and no annotations, the description still covers return fields (status, health_url, dashboard_url, next), every action_required step, credential handling, and unsupported cases (Aurora, RDS Proxy over PrivateLink). Nothing an agent needs in order to call this correctly and interpret the result is left unstated.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds cross-parameter workflow meaning the schema cannot express: the yes/price loop, the ip_first to ip_allowed sequence, nonce plus monitoring_password from a prepare_db result, and vpce_service coming from the stack output. This sequencing context materially helps an agent choose values rather than just describing individual fields.

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

Purpose5/5

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

Opens with a specific verb and resource ('Put a Postgres database under PostgresAI Cloud monitoring') and immediately enumerates the three things it does: prepare the monitoring role, provision the box, and return a JSON result with named fields. An agent knows exactly what the tool accomplishes before reading the rest, and no sibling in this catalog performs a comparable deploy operation.

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

Usage Guidelines4/5

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

Gives explicit branching guidance for every precondition state: pass yes:true only after showing the price, call again to poll status because it does not wait, call with ip_allowed:true only after the user confirms the CIDR, call with monitoring_password+nonce after the user runs the SQL. No alternative tool is named or excluded, but none exists among the siblings, so the practical when-to-use coverage is strong.

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