Tools¶
The MCP server provides these tools for querying and exploring Trino.
Tool Summary¶
| Tool | Description |
|---|---|
trino_query |
Execute SQL queries |
trino_explain |
Analyze execution plans |
trino_list_catalogs |
List available catalogs |
trino_list_schemas |
List schemas in a catalog |
trino_list_tables |
List tables in a schema |
trino_describe_table |
Get columns, sample data, and semantic context |
trino_list_connections |
List configured server connections |
trino_query¶
Execute SQL queries against Trino.
Parameters¶
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
sql |
string | Yes | - | SQL query to execute |
limit |
integer | No | 1000 | Max rows (1-10000) |
format |
string | No | json |
Output: json, csv, markdown |
timeout_seconds |
integer | No | 120 | Timeout (1-300) |
connection |
string | No | default | Server connection |
Examples¶
"Show me the first 10 customers"
"Count orders by status"
"Export users as CSV"
Uses format: "csv" parameter.
trino_explain¶
Analyze query execution plans without running the query.
Parameters¶
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
sql |
string | Yes | - | SQL query to explain |
type |
string | No | LOGICAL |
Plan type |
connection |
string | No | default | Server connection |
Explain Types¶
| Type | Use Case |
|---|---|
LOGICAL |
Understand query structure |
DISTRIBUTED |
See execution stages across nodes |
IO |
Estimate data scanned |
VALIDATE |
Check syntax without planning |
Examples¶
"Why is this query slow?"
Uses type: "DISTRIBUTED" to see where time is spent.
"How much data will this read?"
Uses type: "IO" to see estimated bytes scanned.
trino_list_catalogs¶
List all available data catalogs.
Parameters¶
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
connection |
string | No | default | Server connection |
Example¶
"What databases are available?"
Response:
trino_list_schemas¶
List schemas within a catalog.
Parameters¶
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
catalog |
string | Yes | - | Catalog name |
connection |
string | No | default | Server connection |
Example¶
"Show me the schemas in hive"
Response:
trino_list_tables¶
List tables in a schema with optional pattern filtering.
Parameters¶
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
catalog |
string | Yes | - | Catalog name |
schema |
string | Yes | - | Schema name |
pattern |
string | No | - | LIKE pattern |
connection |
string | No | default | Server connection |
Pattern Syntax¶
| Pattern | Matches |
|---|---|
order% |
Tables starting with "order" |
%log |
Tables ending with "log" |
%event% |
Tables containing "event" |
Example¶
"Show me tables related to orders"
Uses pattern: "%order%":
trino_describe_table¶
Get detailed information about a table including columns, sample data, and semantic context from metadata catalogs.
Semantic Context¶
When a semantic provider is configured, this tool enriches the output with:
- Description: Business-friendly explanation of the table and columns
- Ownership: Data stewards and technical owners
- Tags & Domain: Classification labels and business domain
- Sensitivity: Columns marked as containing PII or sensitive data
- Deprecation: Warnings if the table is deprecated
Parameters¶
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
catalog |
string | Yes | - | Catalog name |
schema |
string | Yes | - | Schema name |
table |
string | Yes | - | Table name |
include_sample |
boolean | No | true | Include sample rows |
connection |
string | No | default | Server connection |
Example¶
"Describe the customers table"
Response:
{
"table": "hive.sales.customers",
"columns": [
{"name": "id", "type": "bigint", "nullable": false},
{"name": "name", "type": "varchar(255)", "nullable": true},
{"name": "email", "type": "varchar(255)", "nullable": true}
],
"sample": [
[1, "Alice Smith", "[email protected]"],
[2, "Bob Jones", "[email protected]"]
]
}
trino_list_connections¶
List all configured Trino server connections.
Parameters¶
None.
Example¶
"What Trino servers are configured?"
Response:
{
"connections": [
{"name": "default", "host": "prod.trino.example.com", "catalog": "hive"},
{"name": "staging", "host": "staging.trino.example.com", "catalog": "hive"},
{"name": "dev", "host": "localhost", "port": 8080, "ssl": false}
],
"default": "default"
}
Common Workflows¶
Data Exploration¶
trino_list_catalogs- See available databasestrino_list_schemas- Browse catalogtrino_list_tables- Find relevant tablestrino_describe_table- Understand structuretrino_query- Query the data
Query Optimization¶
- Write initial query
trino_explainwithIO- Check data scanned- Add filters to reduce data
trino_explainwithDISTRIBUTED- Check stagestrino_query- Run optimized query
Next Steps¶
- Multi-Server - Query multiple clusters
- Tools API Reference - Complete parameter details