Skip to content

list_tables Returns Null Instead of Empty List for Empty Responses #2027

@averikitsch

Description

@averikitsch

Prerequisites

What are you trying to do that currently feels hard or impossible?

Currently, the list_tables command, particularly within the Postgres tools, returns null when there are no tables in the database. This behavior is unexpected; it should return an empty list ([]) instead. This inconsistency can lead to issues in how empty responses are handled by other tools or clients.

Suggested Solution(s)

Declare an empty slice in the postgreslisttables.go file (e.g., internal/tools/postgres/postgreslisttables/postgreslisttables.go#L231) to ensure an empty list is returned when no tables are found. This would align the behavior with expectations for empty responses.

Alternatives Considered

Return a message if no results are found.

Additional Details

No response

Metadata

Metadata

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions