Files
genai-toolbox/docs/en/resources/tools/postgres/postgres-list-pg-settings.md
Srividya Reddy 32367a472f feat(tools/postgres): add list_pg_settings, list_database_stats tools for postgres (#2030)
## Description
Adds the following tools for Postgres:
(1) list_pg_settings: List configuration parameters for the PostgreSQL
server.
(2) list_database_stats: Lists the key performance and activity
statistics for each database in the postgreSQL
  server.

> Should include a concise description of the changes (bug or feature),
it's
> impact, along with a summary of the solution

list_pg_settings:
<img width="1526" height="803" alt="Screenshot 2025-11-25 at 10 19
48 AM"
src="https://github.com/user-attachments/assets/73634b9b-4936-4bf0-a94b-6b31fe3642a1"
/>
<img width="1064" height="715" alt="Screenshot 2025-11-25 at 10 27
19 AM"
src="https://github.com/user-attachments/assets/36c13585-27e4-4294-b451-1c1a963c0d6c"
/>

list_database_stats:
<img width="1511" height="779" alt="Screenshot 2025-11-25 at 10 21
12 AM"
src="https://github.com/user-attachments/assets/d283e018-ea81-427d-b1b4-7aaf79b9696b"
/>
<img width="1017" height="506" alt="Screenshot 2025-11-25 at 10 27
47 AM"
src="https://github.com/user-attachments/assets/47b72bd7-7114-4f2a-8a9d-cecc80bf47e9"
/>



## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #<1738>

Co-authored-by: Averi Kitsch <akitsch@google.com>
Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com>
2025-12-09 11:55:53 -08:00

2.3 KiB

title, type, weight, description, aliases
title type weight description aliases
postgres-list-pg-settings docs 1 The "postgres-list-pg-settings" tool lists PostgreSQL run-time configuration settings.
/resources/tools/postgres-list-pg-settings

About

The postgres-list-pg-settings tool lists the configuration parameters for the postgres server, their current values, and related information. It's compatible with any of the following sources:

postgres-list-pg-settings lists detailed information as JSON for each setting. The tool takes the following input parameters:

  • setting_name (optional): A text to filter results by setting name. Default: ""
  • limit (optional): The maximum number of rows to return. Default: 50.

Example

tools:
  list_indexes:
    kind: postgres-list-pg-settings
    source: postgres-source
    description: |
        Lists configuration parameters for the postgres server ordered lexicographically, 
        with a default limit of 50 rows. It returns the parameter name, its current setting,
        unit of measurement, a short description, the source of the current setting (e.g.,
        default, configuration file, session), and whether a restart is required when the
        parameter value is changed."

The response is a json array with the following elements:

{
 "name": "Setting name",
 "current_value": "Current value of the setting",
 "unit": "Unit of the setting",
 "short_desc": "Short description of the setting",
 "source": "Source of the current value (e.g., default, configuration file, session)",
 "requires_restart": "Indicates if a server restart is required to apply a change ('Yes', 'No', or 'No (Reload sufficient)')"
}

Reference

field type required description
kind string true Must be "postgres-list-pg-settings".
source string true Name of the source the SQL should execute on.
description string false Description of the tool that is passed to the agent.