Skip to content

[#12099] feat(mcp-server): add read tools for table partitions#12128

Open
bharos wants to merge 1 commit into
apache:mainfrom
bharos:add-mcp-partition-read-tools-12099
Open

[#12099] feat(mcp-server): add read tools for table partitions#12128
bharos wants to merge 1 commit into
apache:mainfrom
bharos:add-mcp-partition-read-tools-12099

Conversation

@bharos

@bharos bharos commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add two read-only MCP tools for table partitions:

  • list_of_partitions(catalog, schema, table, details=false) — returns partition
    names by default, or full partition metadata when details=true.
  • get_partition(catalog, schema, table, partition) — returns the metadata of a
    single partition.

They follow the existing metadata-type pattern (interface → plain REST client →
FastMCP tool → factory wiring → mock + unit tests). All user-supplied path
segments are URL-encoded, and authorization is enforced by Gravitino
(LOAD_TABLE), so no filtering logic is added in the MCP layer.

Why are the changes needed?

The server already exposes list_statistics_for_partition, which requires
partition names as input, but there was no tool to discover those names. These
tools close that gap and round out read coverage for partitioned tables.

Fix: #12099

Does this PR introduce any user-facing change?

Yes — two new MCP tools (list_of_partitions, get_partition), tagged
partition.

How was this patch tested?

Added unit tests for the tools (test_partition.py) and for URL-encoding /
query-param handling (test_url_encoding.py). Full unit suite passes
(163 tests); black and pylint (10/10) are clean.

@github-actions

Copy link
Copy Markdown

Code Coverage Report

Overall Project 67.78% 🟢
Files changed No Java source files changed -

Module Coverage
aliyun 1.72% 🔴
api 47.82% 🟢
authorization-common 85.96% 🟢
aws 42.04% 🟢
azure 2.47% 🔴
catalog-common 9.92% 🔴
catalog-fileset 79.74% 🟢
catalog-glue 66.91% 🟢
catalog-hive 79.4% 🟢
catalog-jdbc-common 45.7% 🟢
catalog-jdbc-doris 81.72% 🟢
catalog-jdbc-mysql 79.33% 🟢
catalog-jdbc-postgresql 83.39% 🟢
catalog-jdbc-starrocks 79.16% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 59.18% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 85.86% 🟢
catalog-lakehouse-paimon 84.23% 🟢
catalog-model 77.72% 🟢
cli 44.5% 🟢
client-java 78.27% 🟢
common 51.95% 🟢
core 82.55% 🟢
filesystem-hadoop3 77.28% 🟢
flink 0.0% 🔴
flink-common 47.09% 🟢
flink-runtime 0.0% 🔴
gcp 14.12% 🔴
hadoop-auth 68.0% 🟢
hadoop-common 12.7% 🔴
hive-metastore-common 53.4% 🟢
iceberg-common 64.65% 🟢
iceberg-rest-server 74.99% 🟢
idp-basic 86.02% 🟢
integration-test-common 0.0% 🔴
jobs 66.17% 🟢
lance-common 20.67% 🔴
lance-rest-server 64.84% 🟢
lineage 53.02% 🟢
optimizer 83.17% 🟢
optimizer-api 21.95% 🔴
server 86.05% 🟢
server-common 76.12% 🟢
spark 28.57% 🔴
spark-common 46.01% 🟢
tencent 69.84% 🟢
trino-connector 40.29% 🟢

@bharos
bharos force-pushed the add-mcp-partition-read-tools-12099 branch 3 times, most recently from f4b28f1 to 90915f0 Compare July 22, 2026 04:00
@bharos
bharos force-pushed the add-mcp-partition-read-tools-12099 branch from 90915f0 to 7355e05 Compare July 22, 2026 04:02
@bharos bharos self-assigned this Jul 22, 2026
@bharos
bharos marked this pull request as ready for review July 22, 2026 04:09
@bharos
bharos requested a review from yuqi1129 July 22, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Subtask] feat(mcp-server): read tools for table partitions (list/get)

1 participant