handle_get_table_definition
Retrieve the DDL statement for a specific table in Redshift schema via SQL script. Returns CREATE TABLE statement on success or error details if retrieval fails.
Instructions
Retrieves the DDL (Data Definition Language) statement for a specific table.
Executes a SQL script designed to generate or retrieve the CREATE TABLE
statement for the given table.
Args:
ctx: The MCP context object.
schema_name: The schema name of the table.
table_name: The name of the table.
Returns:
A dictionary conforming to GetTableDefinitionResult structure:
- On success: {"status": "success", "ddl": "<CREATE TABLE statement>"}
- On table not found or DDL retrieval error:
{"status": "error", "error_message": "...", "error_type": "..."}
Raises:
TableNotFound: If the specified table is not found.
DataApiError: If a critical, unexpected error occurs during execution.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
schema_name | Yes | ||
table_name | Yes |
Input Schema (JSON Schema)
{
"properties": {
"schema_name": {
"title": "Schema Name",
"type": "string"
},
"table_name": {
"title": "Table Name",
"type": "string"
}
},
"required": [
"schema_name",
"table_name"
],
"title": "handle_get_table_definitionArguments",
"type": "object"
}