What it does
The Postgres SQL tool lets your agents run SQL queries directly on your PostgreSQL database. Perfect for data analysis, reporting, and retrieving specific information from your database.Requires Postgres Integration: You need to set up a Postgres integration before agents can use this tool.
Key features
- Execute any SQL query (SELECT, INSERT, UPDATE, DELETE)
- Automatic 100-row limit to prevent performance issues
- Clean, structured results that agents can easily parse
- Built-in error handling for common SQL issues
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sql_query | string | Yes | The SQL query to execute |
row_limit | integer | No | Max rows to return (default: 100, max: 1000) |
Common use cases
Data analysis
User lookups
Performance monitoring
Security best practices
- Use read-only database users when possible
- Avoid querying sensitive data (passwords, API keys, PII)
- Use WHERE clauses to limit data exposure
- Monitor agent queries regularly
Troubleshooting
“Could not connect to database”- Check that your Postgres integration is configured and connected
- Verify database server is running and accessible
- Ensure your database user has SELECT permissions
- Check that the table exists and is accessible
- Validate your SQL syntax
- Check table and column names for typos
Related tools
- Semantic Search Postgres - Search using natural language
- Keyword Search Postgres - Full-text search across content
Tool Metadata
- Name:
postgres_sql - Display Name: Postgres SQL
- Description: Execute a SQL query on Postgres
- Required Integration: Postgres
- Row Limit: 100 rows (configurable up to 1,000)
