Trino

v0.8.2
io.github.alaturqua/mcp-trino-python Checked 3 hours ago Published 5 days ago

Query Trino and inspect or maintain Iceberg tables: catalogs, schemas, SQL, snapshots.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

show_catalogs Show Catalogs

List all available catalogs.

show_schemas Show Schemas

List all schemas in a catalog.

ParameterTypeDescription
catalogCatalog name (defaults to TRINO_CATALOG)

show_tables Show Tables

List all tables in a schema.

ParameterTypeDescription
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

describe_table Describe Table

Describe a table's columns and types (JSON).

ParameterTypeDescription
table *stringTable name
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

show_create_table Show Create Table

Show the CREATE TABLE statement for a table.

ParameterTypeDescription
table *stringTable name
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

show_create_view Show Create View

Show the CREATE VIEW statement for a view.

ParameterTypeDescription
view *stringView name
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

show_stats Show Stats

Show column statistics for a table (JSON).

ParameterTypeDescription
table *stringTable name
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

show_catalog_tree Show Catalog Tree

Show a hierarchical tree of all catalogs, schemas and tables. Can be slow on large installations.

show_query_history Show Query History

Show recently executed queries from system.runtime.queries, newest first (JSON).

ParameterTypeDescription
limitMaximum number of entries to return

execute_query Execute Query

Execute a SQL statement and return the rows as JSON. In read-only mode only SELECT, WITH, SHOW, DESCRIBE, EXPLAIN and VALUES statements are allowed.

ParameterTypeDescription
query *stringThe SQL statement to execute

optimize Optimize

Compact small data files of an Iceberg table.

ParameterTypeDescription
table *stringTable name
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

optimize_manifests Optimize Manifests

Rewrite and compact the manifest files of an Iceberg table.

ParameterTypeDescription
table *stringTable name
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

expire_snapshots Expire Snapshots

Remove Iceberg snapshots older than the retention threshold.

ParameterTypeDescription
table *stringTable name
catalogCatalog name (defaults to TRINO_CATALOG)
retention_thresholdstringMinimum snapshot age to remove, e.g. '7d' or '12h'
schema_nameSchema name (defaults to TRINO_SCHEMA)

show_table_properties Show Table Properties

Show Iceberg table properties (JSON).

ParameterTypeDescription
table *stringTable name
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

show_table_history Show Table History

Show Iceberg table history (JSON). Columns: made_current_at, snapshot_id, parent_id, is_current_ancestor.

ParameterTypeDescription
table *stringTable name
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

show_metadata_log_entries Show Metadata Log Entries

Show Iceberg metadata log entries (JSON). Columns: timestamp, file, latest_snapshot_id, latest_schema_id, latest_sequence_number.

ParameterTypeDescription
table *stringTable name
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

show_snapshots Show Snapshots

Show Iceberg table snapshots (JSON). Columns: committed_at, snapshot_id, parent_id, operation, manifest_list, summary.

ParameterTypeDescription
table *stringTable name
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

show_manifests Show Manifests

Show Iceberg manifest files (JSON). Columns: path, length, partition_spec_id, added_snapshot_id, added/existing/deleted data file and row counts, partition_summaries.

ParameterTypeDescription
table *stringTable name
all_snapshotsbooleanInclude all snapshots instead of only the current one
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

show_partitions Show Partitions

Show Iceberg table partitions (JSON). Columns: partition, record_count, file_count, total_size, data (per-column min/max and null counts).

ParameterTypeDescription
table *stringTable name
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

show_files Show Files

Show Iceberg data files in the current snapshot (JSON). Columns include content (0=DATA, 1=POSITION_DELETES, 2=EQUALITY_DELETES), file_path, file_format, record_count, file_size_in_bytes, column sizes/counts and lower/upper bounds.

ParameterTypeDescription
table *stringTable name
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

show_entries Show Entries

Show Iceberg manifest entries (JSON). Columns: status (0=EXISTING, 1=ADDED, 2=DELETED), snapshot_id, sequence_number, file_sequence_number, data_file, readable_metrics.

ParameterTypeDescription
table *stringTable name
all_snapshotsbooleanInclude all snapshots instead of only the current one
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)

show_refs Show Refs

Show Iceberg table references, i.e. branches and tags (JSON).

ParameterTypeDescription
table *stringTable name
catalogCatalog name (defaults to TRINO_CATALOG)
schema_nameSchema name (defaults to TRINO_SCHEMA)