<a id="flink-sql-show"></a>

# SHOW Statements in Confluent Cloud for Apache Flink

Use SHOW statements in Confluent Cloud for Apache Flink to list catalogs (Confluent Cloud environments),
databases (Apache Kafka® clusters), tables, functions, AI models, connections,
and other resources. SHOW CREATE TABLE displays the full definition of a
table, including [inferred tables](#flink-sql-show-inferred-tables)
that Flink detects automatically from existing Kafka topics and
[Schema Registry](../../../sr/schemas-manage.md#sr-prv) schemas.

Confluent Cloud for Apache Flink supports these SHOW statements.

| [SHOW CATALOGS](#flink-sql-show-catalogs)                                   | [SHOW CONNECTIONS](#flink-sql-show-connections)         |
|-----------------------------------------------------------------------------|---------------------------------------------------------|
| [SHOW CREATE MATERIALIZED TABLE](#flink-sql-show-create-materialized-table) | [SHOW CREATE MODEL](#flink-sql-show-create-model)       |
| [SHOW CREATE TABLE](#flink-sql-show-create-table)                           | [SHOW CURRENT CATALOG](#flink-sql-show-current-catalog) |
| [SHOW CURRENT DATABASE](#flink-sql-show-current-database)                   | [SHOW DATABASES](#flink-sql-show-databases)             |
| [SHOW FUNCTIONS](#flink-sql-show-functions)                                 | [SHOW JOBS](#flink-sql-show-jobs)                       |
| [SHOW MODELS](#flink-sql-show-models)                                       | [SHOW TABLES](#flink-sql-show-tables)                   |
| [SHOW AGENTS](#flink-sql-show-agents)                                       | [SHOW TOOLS](#flink-sql-show-tools)                     |
| [SHOW CREATE AGENT](#flink-sql-show-create-agent)                           | [SHOW CREATE TOOL](#flink-sql-show-create-tool)         |

<a id="flink-sql-show-catalogs"></a>

## SHOW CATALOGS

Syntax
: ```sql
  SHOW CATALOGS;
  ```

Description
: Show all catalogs. Confluent Cloud for Apache Flink maps Flink catalogs to environments.

Example
: ```sql
  SHOW CATALOGS;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +-------------------------+------------+
  |      catalog name       | catalog id |
  +-------------------------+------------+
  | my_environment          | env-12abcz |
  | example-streams-env     | env-23xjoo |
  | quickstart-env          | env-9wg8ny |
  | default                 | env-t12345 |
  +-------------------------+------------+
  ```
  <br/>
  Run the [USE CATALOG statement](use-catalog.md#flink-sql-use-catalog-statement) to set
  the current Flink catalog (Confluent Cloud environment).
  <br/>
  ```sql
  USE CATALOG my_environment;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +---------------------+----------------+
  |         Key         |      Value     |
  +---------------------+----------------+
  | sql.current-catalog | my_environment |
  +---------------------+----------------+
  ```

#### NOTE
In Confluent Cloud Console, you can’t run a USE CATALOG statement by itself. It must
be run before other Flink SQL statements, for example:

```sql
USE CATALOG `default`;
SHOW CURRENT CATALOG;
```

<a id="flink-sql-show-connections"></a>

## SHOW CONNECTIONS

Syntax
: ```sql
  SHOW CONNECTIONS [LIKE <sql-like-pattern>];
  ```

Description
: Show all connections.

Example
: ```sql
  SHOW CONNECTIONS;
  <br/>
  -- with name filter
  SHOW CONNECTIONS LIKE 'sql%';
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +-------------------------+
  |     Connection Name     |
  +-------------------------+
  | azure-openai_connection |
  | deepwiki_mcp_connection |
  | demo-day-mcp-connection |
  | mcp-connection          |
  +-------------------------+
  ```

<a id="flink-sql-show-current-catalog"></a>

## SHOW CURRENT CATALOG

Syntax
: ```sql
  SHOW CURRENT CATALOG;
  ```

Description
: Show the current catalog.

Example
: ```sql
  SHOW CURRENT CATALOG;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +----------------------+
  | current catalog name |
  +----------------------+
  | my_environment       |
  +----------------------+
  ```

<a id="flink-sql-show-databases"></a>

## SHOW DATABASES

Syntax
: ```sql
  SHOW DATABASES;
  ```

Description
: Show all databases in the current catalog. Confluent Cloud for Apache Flink maps Flink databases to
  Kafka clusters.

Example
: ```sql
  SHOW DATABASES;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +---------------+-------------+
  | database name | database id |
  +---------------+-------------+
  | cluster_0     | lkc-r289m7  |
  +---------------+-------------+
  ```
  <br/>
  Run the [USE statement](use-database.md#flink-sql-use-database-statement) to set the
  current database (Kafka cluster).
  <br/>
  ```sql
  USE cluster_0;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +----------------------+-----------+
  |         Key          |   Value   |
  +----------------------+-----------+
  | sql.current-database | cluster_0 |
  +----------------------+-----------+
  ```

<a id="flink-sql-show-current-database"></a>

## SHOW CURRENT DATABASE

Syntax
: ```sql
  SHOW CURRENT DATABASE;
  ```

Description
: Show the current database. Confluent Cloud for Apache Flink maps Flink databases to Kafka clusters.

Example
: ```sql
  SHOW CURRENT DATABASE;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +-----------------------+
  | current database name |
  +-----------------------+
  | cluster_0             |
  +-----------------------+
  ```

<a id="flink-sql-show-tables"></a>

## SHOW TABLES

Syntax
: ```sql
  SHOW TABLES [ [catalog_name.]database_name ] [ [NOT] LIKE <sql_like_pattern> ]
  ```

Description
: Show all tables for the current database. You can filter the output of
  SHOW TABLES by using the LIKE clause with an optional matching pattern.
  <br/>
  The optional LIKE clause shows all tables with names that match
  `<sql_like_pattern>`.
  <br/>
  The syntax of the SQL pattern in a `LIKE` clause is the same as in the
  `MySQL` dialect.
  <br/>
  - `%` matches any number of characters, including zero characters. Use the
    backslash character to escape the `%` character: `\%` matches one `%`
    character.
  - `_` matches exactly one character. Use the backslash character to escape
    the `_` character: `\_` matches one `_` character.

Example
: Create two tables in the current catalog: `flights` and `orders`.
  <br/>
  ```sql
  -- Create a flights table.
  CREATE TABLE flights (
    flight_id STRING,
    origin STRING,
    destination STRING
  );
  ```
  <br/>
  ```sql
  -- Create an orders table.
  CREATE TABLE orders (
    user_id BIGINT NOT NULL,
    product_id STRING,
    amount INT
  );
  ```
  <br/>
  Show all tables in the current database that are similar to the
  specified SQL pattern.
  <br/>
  ```sql
  SHOW TABLES LIKE 'f%';
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +------------+
  | table name |
  +------------+
  | flights    |
  +------------+
  ```
  <br/>
  Show all tables in the given database that are not similar to the
  specified SQL pattern.
  <br/>
  ```sql
  SHOW TABLES NOT LIKE 'f%';
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +------------+
  | table name |
  +------------+
  | orders     |
  +------------+
  ```
  <br/>
  Show all tables in the current database.
  <br/>
  ```sql
  SHOW TABLES;
  ```
  <br/>
  ```none
  +------------+
  | table name |
  +------------+
  | flights    |
  | orders     |
  +------------+
  ```

<a id="flink-sql-show-create-materialized-table"></a>

## SHOW CREATE MATERIALIZED TABLE

Syntax
: ```sql
  SHOW CREATE MATERIALIZED TABLE [catalog_name.][db_name.]table_name;
  ```

Description
: Show details about the specified materialized table, including its schema,
  WITH properties, START_MODE, and the AS SELECT query.

Example
: ```sql
  SHOW CREATE MATERIALIZED TABLE enriched_orders;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +-----------------------------------------------------------------------+
  |                   SHOW CREATE MATERIALIZED TABLE                      |
  +-----------------------------------------------------------------------+
  | CREATE MATERIALIZED TABLE `my_env`.`my_cluster`.`enriched_orders` (   |
  |   `order_id` STRING,                                                  |
  |   `customer_id` INT,                                                  |
  |   `price` DOUBLE                                                      |
  | )                                                                     |
  | WITH (                                                                |
  |   'changelog.mode' = 'append',                                        |
  |   'connector' = 'confluent',                                          |
  |   'value.format' = 'avro-registry'                                    |
  | )                                                                     |
  | START_MODE = RESUME_OR_FROM_BEGINNING                                 |
  | AS SELECT order_id, customer_id, price                                |
  | FROM `my_env`.`my_cluster`.`orders`                                   |
  +-----------------------------------------------------------------------+
  ```

<a id="flink-sql-show-create-table"></a>

## SHOW CREATE TABLE

Syntax
: ```sql
  SHOW CREATE TABLE [catalog_name.][db_name.]table_name;
  ```

Description
: Show details about the specified table.

Example
: ```sql
  SHOW CREATE TABLE flights;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +-----------------------------------------------------------+
  |                     SHOW CREATE TABLE                     |
  +-----------------------------------------------------------+
  | CREATE TABLE `my_environment`.`cluster_0`.`flights` (     |
  |   `flight_id` VARCHAR(2147483647),                        |
  |   `origin` VARCHAR(2147483647),                           |
  |   `destination` VARCHAR(2147483647)                       |
  | ) WITH (                                                  |
  |   'changelog.mode' = 'append',                            |
  |   'connector' = 'confluent',                              |
  |   'kafka.cleanup-policy' = 'delete',                      |
  |   'kafka.max-message-size' = '2097164 bytes',             |
  |   'kafka.partitions' = '6',                               |
  |   'kafka.retention.size' = '0 bytes',                     |
  |   'kafka.retention.time' = '604800000 ms',                |
  |   'scan.bounded.mode' = 'unbounded',                      |
  |   'scan.startup.mode' = 'earliest-offset',                |
  |   'value.format' = 'avro-registry'                        |
  | )                                                         |
  |                                                           |
  +-----------------------------------------------------------+
  ```

<a id="flink-sql-show-inferred-tables"></a>

### Inferred Tables

Inferred tables are tables that Flink detects automatically from
existing Kafka topics and their [Schema Registry](../../../sr/schemas-manage.md#sr-prv) schemas,
without requiring a CREATE TABLE statement. Flink maps the topic’s key
and value schemas to Flink SQL columns, so you can query the topic
immediately. Use SHOW CREATE TABLE to see the inferred schema, column
types, and table options.

The following examples show SHOW CREATE TABLE called on the resulting
table.

#### No key and no value in Schema Registry

SHOW CREATE TABLE returns:

```sql
CREATE TABLE `t_raw` (
  `key` VARBINARY(2147483647),
  `val` VARBINARY(2147483647)
) DISTRIBUTED BY HASH(`key`) INTO 2 BUCKETS
WITH (
  'changelog.mode' = 'append',
  'connector' = 'confluent',
  'key.format' = 'raw',
  'value.format' = 'raw'
  ...
);
```

Properties
: - Key and value formats are raw (binary format) with BYTES
  - Following Kafka message semantics, both key and value support NULL as well,
    so the following statement is supported:
    ```sql
    INSERT INTO t_raw (key, val) SELECT CAST(NULL AS BYTES), CAST(NULL AS BYTES);
    ```

#### No key but record value in Schema Registry

Given the following value in Schema Registry:

```json
{
  "type": "record",
  "name": "TestRecord",
  "fields": [
    {
      "name": "i",
      "type": "int"
    },
    {
      "name": "s",
      "type": "string"
    }
  ]
}
```

SHOW CREATE TABLE returns:

```sql
CREATE TABLE `t_raw_key` (
  `key` VARBINARY(2147483647),
  `i` INT NOT NULL,
  `s` VARCHAR(2147483647) NOT NULL
) DISTRIBUTED BY HASH(`key`) INTO 6 BUCKETS
WITH (
  'changelog.mode' = 'append',
  'connector' = 'confluent',
  'key.format' = 'raw',
  'value.format' = 'avro-registry'
  ...
)
```

Properties
: - Key format is raw (binary format) with BYTES
  - Following Kafka message semantics, the key supports NULL, so the following
    statement is supported:
    ```sql
    INSERT INTO t_raw_key SELECT CAST(NULL AS BYTES), 12, 'Bob';
    ```

#### Atomic key and record value in Schema Registry

Given the following key and value in Schema Registry:

```json
"int"
```

```json
{
  "type": "record",
  "name": "TestRecord",
  "fields": [
     {
        "name": "i",
        "type": "int"
     },
     {
        "name": "s",
        "type": "string"
     }
  ]
}
```

SHOW CREATE TABLE returns:

```sql
CREATE TABLE `t_atomic_key` (
  `key` INT NOT NULL,
  `i` INT NOT NULL,
  `s` VARCHAR(2147483647) NOT NULL
) DISTRIBUTED BY HASH(`key`) INTO 2 BUCKETS
WITH (
  'changelog.mode' = 'append',
  'connector' = 'confluent',
  'key.format' = 'avro-registry',
  'value.format' = 'avro-registry'
  ...
)
```

Properties
: - Schema Registry defines column data type INT NOT NULL.
  - The column name `key` is used as a default, because Schema Registry doesn’t provide
    a column name.

#### Overlapping names in key/value, no key in Schema Registry

Given the following value in Schema Registry:

```json
{
  "type": "record",
  "name": "TestRecord",
  "fields": [
     {
        "name": "i",
        "type": "int"
     },
     {
        "name": "s",
        "type": "string"
     }
  ]
}
```

SHOW CREATE TABLE returns:

```sql
CREATE TABLE `t_raw_disjoint` (
  `key_key` VARBINARY(2147483647),
  `i` INT NOT NULL,
  `key` VARCHAR(2147483647) NOT NULL
) DISTRIBUTED BY HASH(`key_key`) INTO 1 BUCKETS
WITH (
  'changelog.mode' = 'append',
  'connector' = 'confluent',
  'key.fields-prefix' = 'key_',
  'key.format' = 'raw',
  'value.format' = 'avro-registry'
  ...
)
```

Properties
: - Schema Registry value defines columns INT NOT NULL and `key STRING`
  - The column name `key BYTES` is used as a default if no key is in Schema Registry
  - Because `key` would collide with value column, `key_` prefix is added

#### Record key and record value in Schema Registry

Given the following key and value in Schema Registry:

```json
{
  "type": "record",
  "name": "TestRecord",
  "fields": [
     {
        "name": "uid",
        "type": "int"
     }
  ]
}
```

```json
{
  "type": "record",
  "name": "TestRecord",
  "fields": [
     {
        "name": "name",
        "type": "string"
     },
     {
        "name": "zip_code",
        "type": "string"
     }
  ]
}
```

SHOW CREATE TABLE returns:

```sql
CREATE TABLE `t_sr_disjoint` (
  `uid` INT NOT NULL,
  `name` VARCHAR(2147483647) NOT NULL,
  `zip_code` VARCHAR(2147483647) NOT NULL
) DISTRIBUTED BY HASH(`uid`) INTO 1 BUCKETS
WITH (
  'changelog.mode' = 'append',
  'connector' = 'confluent',
  'value.format' = 'avro-registry'
  ...
)
```

Properties
: - Schema Registry defines columns for both key and value.
  - The column names of key and value are disjoint sets and don’t overlap.

#### Record key and record value with overlap in Schema Registry

Given the following key and value in Schema Registry:

```json
{
  "type": "record",
  "name": "TestRecord",
  "fields": [
     {
        "name": "uid",
        "type": "int"
     }
  ]
}
```

```json
{
  "type": "record",
  "name": "TestRecord",
  "fields": [
     {
        "name": "uid",
        "type": "int"
     },{
        "name": "name",
        "type": "string"
     },
     {
        "name": "zip_code",
        "type": "string"
     }
  ]
}
```

SHOW CREATE TABLE returns:

```sql
CREATE TABLE `t_sr_joint` (
  `uid` INT NOT NULL,
  `name` VARCHAR(2147483647) NOT NULL,
  `zip_code` VARCHAR(2147483647) NOT NULL
) DISTRIBUTED BY HASH(`uid`) INTO 1 BUCKETS
WITH (
  'changelog.mode' = 'append',
  'connector' = 'confluent',
  'value.fields-include' = 'all',
  'value.format' = 'avro-registry'
  ...
)
```

Properties
: - Schema Registry defines columns for both key and value.
  - The column names of key and value overlap on `uid`.
  - `'value.fields-include' = 'all'` is set to exclude the key because it is
    fully contained in the value.

### Inferred tables schema evolution

#### Schema Registry columns overlap with computed/metadata columns

Given the following value in Schema Registry:

```json
{
  "type": "record",
  "name": "TestRecord",
  "fields": [
     {
        "name": "uid",
        "type": "int"
     }
  ]
}
```

Evolve the table by adding metadata:

```sql
ALTER TABLE t_metadata_overlap ADD `timestamp` TIMESTAMP_LTZ(3) NOT NULL METADATA;
```

Evolve the table by adding an optional schema column:

```json
{
  "type": "record",
  "name": "TestRecord",
  "fields": [
     {
        "name": "uid",
        "type": "int"
     },
     {
        "name": "timestamp",
        "type": ["null", "string"],
        "default": null
     }
  ]
}
```

SHOW CREATE TABLE shows:

```sql
CREATE TABLE `t_metadata_overlap` (
  `key` VARBINARY(2147483647),
  `uid` INT NOT NULL,
  `timestamp` TIMESTAMP(3) WITH LOCAL TIME ZONE NOT NULL METADATA
) DISTRIBUTED BY HASH(`key`) INTO 6 BUCKETS
WITH (
  ...
)
```

Properties
: - Schema Registry says there is a timestamp physical column, but Flink says there is
    timestamp metadata column.
  - In this case, metadata columns and computed columns have precedence, so
    Flink removes the physical column from the schema.
  - Given that Flink advertises FULL_TRANSITIVE mode, queries still work, and
    the physical column is set to NULL in the payload:
    ```sql
    INSERT INTO t_metadata_overlap
      SELECT CAST(NULL AS BYTES), 42, TO_TIMESTAMP_LTZ(0, 3);
  <br/>
    SELECT * FROM t_metadata_overlap;
    ```

Evolve the table by renaming metadata:

```sql
ALTER TABLE t_metadata_overlap DROP `timestamp`;

ALTER TABLE t_metadata_overlap
  ADD message_timestamp TIMESTAMP_LTZ(3) METADATA FROM 'timestamp';
```

SHOW CREATE TABLE shows:

```sql
CREATE TABLE `t_metadata_overlap` (
  `key` VARBINARY(2147483647),
  `uid` INT NOT NULL,
  `timestamp` VARCHAR(2147483647),
  `message_timestamp` TIMESTAMP(3) WITH LOCAL TIME ZONE METADATA FROM 'timestamp'
) DISTRIBUTED BY HASH(`key`) INTO 6 BUCKETS
WITH (
  ...
)
```

Properties
: - Now, both physical and metadata column show up and can be accessed both
    for reading and writing.

<a id="flink-sql-show-jobs"></a>

## SHOW JOBS

Syntax
: ```sql
  SHOW JOBS;
  ```

Description
: Show the status of all statements in the current catalog/environment.

Example
: ```sql
  SHOW JOBS;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +----------------------------------+-----------+------------------+--------------+------------------+------------------+
  |               Name               |   Phase   |    Statement     | Compute Pool |  Creation Time   |      Detail      |
  +----------------------------------+-----------+------------------+--------------+------------------+------------------+
  | 0fb72c57-8e3d-4614               | COMPLETED | CREATE TABLE ... | lfcp-8m03rm  | 2024-01-23 13... | Table 'flight... |
  | 8567b0eb-fabd-4cb8               | COMPLETED | CREATE TABLE ... | lfcp-8m03rm  | 2024-01-23 13... | Table 'orders... |
  | 4cd171ca-77db-48ce               | COMPLETED | SHOW TABLES L... | lfcp-8m03rm  | 2024-01-23 13... |                  |
  | 291eb50b-965c-4a53               | COMPLETED | SHOW TABLES N... | lfcp-8m03rm  | 2024-01-23 13... |                  |
  | 7a30e70a-36af-41f4               | COMPLETED | SHOW TABLES;     | lfcp-8m03rm  | 2024-01-23 13... |                  |
  +----------------------------------+-----------+------------------+--------------+------------------+------------------+
  ```

<a id="flink-sql-show-functions"></a>

## SHOW FUNCTIONS

Syntax
: ```sql
  SHOW [USER] FUNCTIONS;
  ```

Description
: Show all functions including system functions and user-defined functions
  in the current catalog and current database. Both system and catalog
  functions are returned.
  <br/>
  The `USER` option shows only user-defined functions in the current catalog
  and current database.
  <br/>
  Functions of internal modules are shown if your Organization is in the
  allow-list, for example, OLTP functions.
  <br/>
  For convenience, SHOW FUNCTIONS also shows functions with special syntax or
  keywords that don’t follow a traditional functional-style syntax, such as
  `FUNC(arg0)`. For example, `||` (string concatenation) or `IS BETWEEN`.

Example
: ```sql
  SHOW FUNCTIONS;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +------------------------+
  |     function name      |
  +------------------------+
  | %                      |
  | *                      |
  | +                      |
  | -                      |
  | /                      |
  | <                      |
  | <=                     |
  | <>                     |
  | =                      |
  | >                      |
  | >=                     |
  | ABS                    |
  | ACOS                   |
  | AND                    |
  | ARRAY                  |
  | ARRAY_CONTAINS         |
  | ASCII                  |
  | ASIN                   |
  | ATAN                   |
  | ATAN2                  |
  | AVG                    |
  ...
  ```

<a id="flink-sql-show-models"></a>

## SHOW MODELS

Syntax
: ```sql
  SHOW MODELS [ ( FROM | IN ) [catalog_name.]database_name ]
  [ [NOT] LIKE <sql_like_pattern> ];
  ```

Description
: Show all AI models that are registered in the current Flink environment.
  <br/>
  To register an AI model, run the [CREATE MODEL](create-model.md#flink-sql-create-model)
  statement.

Example
: ```sql
  SHOW MODELS;
  ```
  <br/>
  Your output should resemble:

```none
+----------------+
|   Model Name   |
+----------------+
|   demo_model   |
+----------------+
```

<a id="flink-sql-show-agents"></a>

## SHOW AGENTS

Syntax
: ```sql
  SHOW AGENTS
  ```

Description
: Show all Streaming Agents registered in the current environment. The
  statement returns a list of agent names for the current Flink environment.

Example
: ```sql
  SHOW AGENTS;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +---------------+
  | Agent Name    |
  +---------------+
  | claim_agent   |
  +---------------+
  ```

<a id="flink-sql-show-tools"></a>

## SHOW TOOLS

Syntax
: ```sql
  SHOW TOOLS (FROM | IN) [[catalog_name.]database_name]
  [ [NOT] LIKE <sql_like_pattern> ]
  ```

Description
: The SHOW TOOLS statement displays the names of all tool resources registered
  in the current environment. This includes both function-based tools and
  connection-based tools.

Examples
: List all tools:
  <br/>
  ```sql
  SHOW TOOLS;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +--------------------+
  | Tool Name          |
  +--------------------+
  | convert_to_celsius |
  | weather_api        |
  | calculator         |
  +--------------------+
  ```
  <br/>
  List tools with pattern matching:
  <br/>
  ```sql
  SHOW TOOLS LIKE 'mcp%';
  ```
  <br/>
  List tools from specific database:
  <br/>
  ```sql
  SHOW TOOLS FROM my_database;
  ```

<a id="flink-sql-show-create-agent"></a>

## SHOW CREATE AGENT

Syntax
: ```sql
  SHOW CREATE AGENT [[catalog_name.]database_name.]agent_name
  ```

Description
: Show details about the specified agent. This command is useful for
  understanding the configuration and options that were set when the agent
  was created with the [CREATE AGENT](create-agent.md#flink-sql-create-agent) statement.

Example
: ```sql
  SHOW CREATE AGENT weather_agent;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +-----------------------------------------------------------+
  |                     SHOW CREATE AGENT                     |
  +-----------------------------------------------------------+
  | CREATE AGENT `weather_agent`                              |
  | USING MODEL `openai`                                      |
  | USING PROMPT 'Find weather info for provided city'        |
  | USING TOOLS mcp_server, convert_to_celsius_tool           |
  | WITH (                                                    |
  |   'max_iterations' = '10'                                 |
  | )                                                         |
  +-----------------------------------------------------------+
  ```

<a id="flink-sql-show-create-tool"></a>

## SHOW CREATE TOOL

Syntax
: ```sql
  SHOW CREATE TOOL [[catalog_name.]database_name.]tool_name
  ```

Description
: Show details about the specified tool. This command is useful for
  understanding the configuration and options that were set when the tool
  was created with the [CREATE TOOL](create-tool.md#flink-sql-create-tool) statement.

Example
: ```sql
  SHOW CREATE TOOL convert_to_celsius_tool;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +-----------------------------------------------------------+
  |                     SHOW CREATE TOOL                      |
  +-----------------------------------------------------------+
  | CREATE TOOL `convert_to_celsius_tool`                     |
  | USING FUNCTION `convert_to_celsius`                       |
  | WITH (                                                    |
  |   'type' = 'function',                                    |
  |   'description' = 'Convert temperature from F to C'       |
  | )                                                         |
  +-----------------------------------------------------------+
  ```
  <br/>
  For an MCP tool:
  <br/>
  ```sql
  SHOW CREATE TOOL mcp_server;
  ```
  <br/>
  Your output should resemble:
  <br/>
  ```none
  +-----------------------------------------------------------+
  |                     SHOW CREATE TOOL                      |
  +-----------------------------------------------------------+
  | CREATE TOOL `mcp_server`                                  |
  | USING CONNECTION `mcp_connection`                         |
  | WITH (                                                    |
  |   'type' = 'mcp',                                  |
  |   'allowed_tools' = 'tool1,tool2',                        |
  |   'request_timeout' = '30'                                |
  | )                                                         |
  +-----------------------------------------------------------+
  ```

<a id="flink-sql-show-create-model"></a>

## SHOW CREATE MODEL

Syntax
: ```sql
  SHOW CREATE MODEL <model-name>;
  ```

Description
: Show details about the specified AI inference model.
  <br/>
  This command is useful for understanding the configuration and options that
  were set when the model was created with the
  [CREATE MODEL](create-model.md#flink-sql-create-model) statement.

Example
: For an example AWS Bedrock model named “bedrock_embed”, the following
  statement might display the shown output.
  <br/>
  ```sql
  SHOW CREATE MODEL bedrock_embed;
  <br/>
  -- Example SHOW CREATE MODEL output:
  CREATE MODEL `model-testing`.`virtual_topic_GCP`.`bedrock_embed`
  INPUT (`text` VARCHAR(2147483647))
  OUTPUT (`response` ARRAY<FLOAT>)
  WITH (
    'BEDROCK.CONNECTION' = 'bedrock_connection',
    'BEDROCK.INPUT_FORMAT' = 'AMAZON-TITAN-EMBED',
    'PROVIDER' = 'bedrock',
    'TASK' = 'text_generation'
  );
  ```

## Related content

- [DESCRIBE](describe.md#flink-sql-describe)
- [USE CATALOG](use-catalog.md#flink-sql-use-catalog-statement)
- [CREATE TABLE](create-table.md#flink-sql-create-table)
- [ALTER TABLE](alter-table.md#flink-sql-alter-table)
- [Schema Registry](../../../sr/schemas-manage.md#sr-prv)
- [Data Type Mappings](../serialization.md#flink-sql-serialization)
- [CREATE MODEL](create-model.md#flink-sql-create-model)

#### NOTE
This website includes content developed at the [Apache Software Foundation](https://www.apache.org/)
under the terms of the [Apache License v2](https://www.apache.org/licenses/LICENSE-2.0.html).
