Postgres
Tools to query and explore a postgres database
0.6.1The Arcade Postgres toolkit connects agents to a PostgreSQL database, enabling read-only schema exploration and SQL querying without any OAuth flow.
Capabilities
- Schema & table discovery — enumerate all schemas and tables in the database before constructing queries, ensuring agents always work with known structure.
- Read-only SQL execution — run
SELECTqueries with full support for joins, filtering, aggregation, ordering, and pagination; all write operations (INSERT,UPDATE,DELETE, etc.) are blocked. - Guided query discipline — built-in tool instructions enforce best practices: no
SELECT *, always order results, case-insensitive/trimmed string matching,LIKEover regex, and index-only joins.
Secrets
POSTGRES_DATABASE_CONNECTION_STRING — A PostgreSQL connection string that encodes the host, port, database name, username, and password needed to reach your database (e.g., postgresql://user:password@host:5432/dbname). Obtain the individual components from wherever your Postgres instance is hosted:
- Self-hosted / on-prem — use the credentials set during database installation or via
psql/pg_hba.conf. - AWS RDS / Aurora — find the endpoint, port, and credentials in the RDS console under your instance's Connectivity & security tab. The password is the one set at creation time or reset via Modify.
- Google Cloud SQL — retrieve the connection name and credentials from the Cloud SQL console; use the public IP or Cloud SQL Auth Proxy address.
- Supabase — go to Project Settings → Database in the Supabase dashboard and copy the Connection string under Connection pooling or direct connection.
- Neon — open your project in the Neon console, navigate to Connection Details, and copy the connection string.
- Railway / Render / other PaaS — find the
DATABASE_URLor equivalent environment variable exposed in your project's settings panel.
The secret should be stored in Arcade and is passed to each tool call at runtime — never hard-coded. See the Arcade secrets docs for setup instructions: https://docs.arcade.dev/en/guides/create-tools/tool-basics/create-tool-secrets. You can also manage secrets directly at https://api.arcade.dev/dashboard/auth/secrets.
Available tools(4)
| Tool name | Description | Secrets | |
|---|---|---|---|
Discover all the schemas in the postgres database. | 1 | ||
Discover all the tables in the postgres database when the list of tables is not known.
ALWAYS use this tool before any other tool that requires a table name. | 1 | ||
You have a connection to a postgres database.
Execute a SELECT query and return the results against the postgres database.
No other queries (INSERT, UPDATE, DELETE, etc.) are allowed.
ONLY use this tool if you have already loaded the schema of the tables you need to query.
Use the <GetTableSchema> tool to load the schema if not already known.
The final query will be constructed as follows:
SELECT {select_query_part} FROM {from_clause} JOIN {join_clause}
WHERE {where_clause} HAVING {having_clause}
ORDER BY {order_by_clause} LIMIT {limit} OFFSET {offset}
When running queries, follow these rules which will help avoid errors:
* Never "select *" from a table. Always select the columns you need.
* Always order your results. Use the most important columns or the primary key if you're unsure.
* Always use case-insensitive queries to match strings in the query.
* Always trim strings in the query.
* Prefer LIKE queries over direct string matches or regex queries.
* Only join on columns that are indexed or the primary key. Do not join on arbitrary columns. | 1 | ||
Get the schema/structure of a postgres table in the postgres database
when the schema is not known, and the name of the table is provided.
This tool should ALWAYS be used before executing any query.
All tables in the query must be discovered first
using the <DiscoverTables> tool. | 1 |