Sim

PostgreSQL

Connect to PostgreSQL database

The PostgreSQL tool enables you to connect to any PostgreSQL database and perform a wide range of database operations directly within your agentic workflows. With secure connection handling and flexible configuration, you can easily manage and interact with your data.

With the PostgreSQL tool, you can:

  • Query data: Execute SELECT queries to retrieve data from your PostgreSQL tables using the postgresql_query operation.
  • Insert records: Add new rows to your tables with the postgresql_insert operation by specifying the table and data to insert.
  • Update records: Modify existing data in your tables using the postgresql_update operation, providing the table, new data, and WHERE conditions.
  • Delete records: Remove rows from your tables with the postgresql_delete operation, specifying the table and WHERE conditions.
  • Execute raw SQL: Run any custom SQL command using the postgresql_execute operation for advanced use cases.

The PostgreSQL tool is ideal for scenarios where your agents need to interact with structured data—such as automating reporting, syncing data between systems, or powering data-driven workflows. It streamlines database access, making it easy to read, write, and manage your PostgreSQL data programmatically.

Usage Instructions

Integrate PostgreSQL into the workflow. Can query, insert, update, delete, and execute raw SQL.

Tools

postgresql_query

Execute a SELECT query on PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
querystringYesSQL SELECT query to execute

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows returned

postgresql_insert

Insert data into PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to insert data into
dataobjectYesData object to insert (key-value pairs)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayInserted data (if RETURNING clause used)
rowCountnumberNumber of rows inserted

postgresql_update

Update data in PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to update data in
dataobjectYesData object with fields to update (key-value pairs)
wherestringYesWHERE clause condition (without WHERE keyword)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayUpdated data (if RETURNING clause used)
rowCountnumberNumber of rows updated

postgresql_delete

Delete data from PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to delete data from
wherestringYesWHERE clause condition (without WHERE keyword)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayDeleted data (if RETURNING clause used)
rowCountnumberNumber of rows deleted

postgresql_execute

Execute raw SQL query on PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
querystringYesRaw SQL query to execute

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows affected

Notes

  • Category: tools
  • Type: postgresql
PostgreSQL