Files
genai-toolbox/docs/en/resources/tools/postgres/postgres-list-views.md
Srividya Reddy e8c7fe0994 feat(tools/postgres-list-views): add new postgres-list-views tool (#1709)
## Description

Adds a read-only PostgreSQL custom list_views tool, that returns the
details of views present in database. Each row includes: schema_name,
view_name, owner_name
Test Output:

<img width="2433" height="1274" alt="Screenshot 2025-10-19 at 3 59
31 PM"
src="https://github.com/user-attachments/assets/76e1e994-390a-4239-aba7-0d02253bbcc4"
/>
<img width="2533" height="1017" alt="Screenshot 2025-10-19 at 4 07
25 PM"
src="https://github.com/user-attachments/assets/537fbddd-d862-4044-a09b-cb9f180c21fa"
/>

## 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>
2025-10-29 14:18:29 -07:00

1.6 KiB

title, type, weight, description, aliases
title type weight description aliases
postgres-list-views docs 1 The "postgres-list-views" tool lists views in a Postgres database, with a default limit of 50 rows.
/resources/tools/postgres-list-views

About

The postgres-list-views tool retrieves a list of top N (default 50) views from a Postgres database, excluding those in system schemas (pg_catalog, information_schema). It's compatible with any of the following sources:

postgres-list-views lists detailed view information (schemaname, viewname, ownername) as JSON for views in a database. The tool takes the following input parameters:

  • viewname (optional): A string pattern to filter view names. The search uses SQL LIKE operator to filter the views. Default: ""
  • limit (optional): The maximum number of rows to return. Default: 50.

Example

tools:
  list_views:
    kind: postgres-list-views
    source: cloudsql-pg-source

Reference

field type required description
kind string true Must be "postgres-list-views".
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.