Files
genai-toolbox/docs/en/resources/tools/postgres/postgres-list-tablespaces.md
Srividya Reddy 5ad7c6127b feat(tools/postgres-list-tablespaces): add new postgres-list-tablespaces tool (#1934)
## Description
Adds a postgresql custom list_tablespaces tool, that returns the details
of tablespaces present in database.

<img width="1719" height="698" alt="Screenshot 2025-11-12 at 9 11 13 AM"
src="https://github.com/user-attachments/assets/03964a1b-27e0-4da8-85a2-57db905163ed"
/>
<img width="1077" height="141" alt="Screenshot 2025-11-12 at 9 12 42 AM"
src="https://github.com/user-attachments/assets/f93f5692-eb62-4f30-8192-40c8873d4d00"
/>


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

Lists all tablespaces in the database. Returns the tablespace name,
owner name, size in bytes, internal object ID, the access control list
regarding permissions, and any specific tablespace options.

## 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
2025-12-04 20:38:54 +00:00

2.1 KiB

title, type, weight, description, aliases
title type weight description aliases
postgres-list-tablespaces docs 1 The "postgres-list-tablespaces" tool lists tablespaces in a Postgres database.
/resources/tools/postgres-list-tablespaces

About

The postgres-list-tablespaces tool lists available tablespaces in the database. It's compatible with any of the following sources:

postgres-list-tablespaces lists detailed information as JSON for tablespaces. The tool takes the following input parameters:

  • tablespace_name (optional): A text to filter results by tablespace name. Default: ""
  • limit (optional): The maximum number of tablespaces to return. Default: 50

Example

tools:
  list_tablespaces:
    kind: postgres-list-tablespaces
    source: postgres-source
    description: |
      Lists all tablespaces in the database. Returns the tablespace name,
      owner name, size in bytes(if the current user has CREATE privileges on
      the tablespace, otherwise NULL), internal object ID, the access control
      list regarding permissions, and any specific tablespace options.

The response is a json array with the following elements:

{
 "tablespace_name": "name of the tablespace",
 "owner_username": "owner of the tablespace",
 "size_in_bytes": "size in bytes if the current user has CREATE privileges on the tablespace, otherwise NULL",
 "oid": "Object ID of the tablespace",
 "spcacl": "Access privileges",
 "spcoptions": "Tablespace-level options (e.g., seq_page_cost, random_page_cost)"
}

Reference

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