This is an automated email from the ASF dual-hosted git repository.
FreeOnePlus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-mcp-server.git
The following commit(s) were added to refs/heads/master by this push:
new 9f43ad0 fix: constrain resource growth selectors (#197)
9f43ad0 is described below
commit 9f43ad006262ccd47c5caf35d5d223953ee76733
Author: Yijia Su <[email protected]>
AuthorDate: Sat Aug 1 14:41:21 2026 +0800
fix: constrain resource growth selectors (#197)
---
CHANGELOG.md | 3 +++
doris_mcp_server/tools/domain_catalog.py | 9 +++++++-
test/tools/test_domain_dispatcher.py | 39 ++++++++++++++++++++++++++++++++
3 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f6ce140..20641c7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -65,6 +65,9 @@ under **Unreleased** until a new version is selected and
published.
### Fixed
+- Declared the exact `storage`, `query_volume`, and `user_activity` selectors
+ for resource-growth analysis, including their recorded evidence sources, so
+ Hosts reject ambiguous values before dispatching a Doris query.
- Updated JWT decoding type contracts for PyJWT 2.13 while preserving the
existing signature, claim, audience, issuer, and unsafe-debug validation
behavior.
diff --git a/doris_mcp_server/tools/domain_catalog.py
b/doris_mcp_server/tools/domain_catalog.py
index b9a7ece..a515aaf 100644
--- a/doris_mcp_server/tools/domain_catalog.py
+++ b/doris_mcp_server/tools/domain_catalog.py
@@ -1509,7 +1509,14 @@ DOMAIN_DEFINITIONS = (
"missing history.",
_input_schema(
{
- "resource": _string("Resource type."),
+ "resource": _string(
+ "Recorded resource series to analyze: storage uses
"
+ "partition creation evidence, query_volume counts "
+ "audit-log queries, and user_activity counts
distinct "
+ "audit-log users. Omit to request every available "
+ "series.",
+ enum=("storage", "query_volume", "user_activity"),
+ ),
"window_days": _integer(
"Lookback window in days.",
minimum=1,
diff --git a/test/tools/test_domain_dispatcher.py
b/test/tools/test_domain_dispatcher.py
index 1e738af..11ea194 100644
--- a/test/tools/test_domain_dispatcher.py
+++ b/test/tools/test_domain_dispatcher.py
@@ -153,6 +153,45 @@ def test_cluster_domain_binds_all_eleven_children() ->
None:
)
+def test_resource_growth_declares_exact_resource_selectors() -> None:
+ child = DORIS_DOMAIN_CATALOG.resolve_child(
+ "doris_cluster",
+ "analyze_resource_growth",
+ )
+
+ assert child.input_schema["properties"]["resource"]["enum"] == (
+ "storage",
+ "query_volume",
+ "user_activity",
+ )
+
+
[email protected]
+async def test_resource_growth_rejects_ambiguous_selector_before_runtime() ->
None:
+ manager = _manager("doris_cluster.analyze_resource_growth")
+ manager.cluster_runtime.analyze_resource_growth = AsyncMock()
+
+ result = await manager.domain_dispatcher.call_domain(
+ "doris_cluster",
+ {
+ "child_tool": "analyze_resource_growth",
+ "arguments": {
+ "resource": "query",
+ "window_days": 7,
+ "granularity": "day",
+ },
+ },
+ None,
+ )
+
+ assert result.mode == "error"
+ assert result.error.code is DomainErrorCode.CHILD_ARGUMENTS_INVALID
+ assert [dict(item) for item in result.error.details["violations"]] == [
+ {"instancePath": "/resource", "keyword": "enum"}
+ ]
+ manager.cluster_runtime.analyze_resource_growth.assert_not_awaited()
+
+
def test_governance_domain_binds_all_eight_children() -> None:
manager = _manager()
bound = BoundHandlerAvailabilityProvider(manager)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]