Postgres
Arcade Optimized
Tools to query and explore a postgres database
Author:Arcade
Version:
2.0.1Auth:No authentication required
4tools
4require secrets
Postgres Toolkit
The Arcade Postgres toolkit connects agents to a PostgreSQL database, enabling structured schema discovery and read-only SQL querying without requiring OAuth or API keys.
Capabilities
- Schema discovery: Enumerate all schemas, tables, and column definitions in the target database before constructing any query.
- Read-only querying: Execute
SELECTstatements with full support for joins, filtering, grouping, ordering, pagination (LIMIT/OFFSET), and aggregations — write operations (INSERT,UPDATE,DELETE) are blocked. - Safe query patterns enforced: Tools are documented to require schema discovery before execution, and query rules (no
SELECT *, case-insensitive matching, trimming,LIKEpreference, index-only joins) are baked into tool guidance to minimize runtime errors.
Secrets
POSTGRES_DATABASE_CONNECTION_STRING— A full PostgreSQL connection string (URI) used to authenticate and connect to the target database. The format is typicallypostgresql://user:password@host:port/dbname(orpostgres://…). Obtain the host, port, database name, username, and password from wherever your Postgres instance is managed — for example, the connection details page of your cloud provider (e.g., AWS RDS, Supabase, Neon, Railway, or a self-hosted instance). The user specified must have at minimumCONNECTprivilege on the database andSELECTprivilege on any schemas/tables the agent needs to read. Do not grant write privileges unless required outside this toolkit. Store the value as a secret (never in plaintext) and rotate it if credentials change.
See the Arcade secrets guide for instructions on registering secrets, or manage them directly at https://api.arcade.dev/dashboard/auth/secrets.
Available tools(4)
4 of 4 tools
Operations
Behavior
| Tool name | Description | Secrets | |
|---|---|---|---|
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,
so that their exact names are known. | 1 | ||
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.
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 |
Last updated on