redshift_list_tables
List all tables in a specific Redshift schema to explore database structure and identify available data tables for querying.
Instructions
List all tables in a specific schema.
Args:
schema: The schema name (default: "public")
Returns:
JSON list of table names
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "redshift_list_tables"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | No | public |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- redshift_mcp_server.py:77-94 (handler)The handler function for the 'redshift_list_tables' tool, decorated with @mcp.tool() for registration. It generates a SQL query to list tables in the specified schema and delegates execution to the 'redshift_query' tool.
@mcp.tool() def redshift_list_tables(schema: str = "public") -> str: """ List all tables in a specific schema. Args: schema: The schema name (default: "public") Returns: JSON list of table names """ sql = f""" SELECT table_name FROM information_schema.tables WHERE table_schema = '{schema}' AND table_type = 'BASE TABLE' """ return redshift_query(sql)