X-LightYear opened a new issue, #5008:
URL: https://github.com/apache/rocketmq-dashboard/issues/5008

   ## Problem
   
   The `rmq.instance.metrics` MCP tool catalog advertises an input contract 
that does not match the implemented metrics query path.
   
   ## Production path
   
   `McpToolRegistrar` publishes `ToolDefinition.inputSchema()` from 
`server/src/main/resources/tool-catalog/tools/instance.yaml`. 
`ToolValidationFilter` validates every call against that schema before 
`InstanceMetricsToolHandler` converts the input into `MetricQueryDTO`. The 
handler and `MetricsService.resolveMetricQuery` support either raw `metric` or 
the semantic pair `profileId` + `semanticMetric`, and 
`MetricsService.validateQueryWindow` requires `step`.
   
   ## Reproduction
   
   Call the advertised `rmq.instance.metrics` tool with:
   
   ```json
   {
     instanceId: instance-a,
     profileId: rocketmq5-native,
     semanticMetric: consumer_lag_messages,
     start: 1784112606,
     end: 1784114406,
     step: 30s
   }
   ```
   
   ## Expected behavior
   
   The catalog schema should accept the supported semantic metric form and 
should require all fields that the handler/service require, including `step`.
   
   ## Actual behavior
   
   The catalog requires `metric`, so the supported semantic form is rejected by 
the runtime `ToolValidationFilter` before the handler runs. Conversely, `step` 
is omitted from the catalog `required` list, so a planner can generate a 
schema-valid call that reaches the service and fails with `Metric query step is 
required`.
   
   ## Root cause
   
   The catalog entry was not updated when semantic metric selection was added 
to the Java metrics query flow. Its top-level required list still models only 
raw PromQL and omits the service-required step field.
   
   ## Scope
   
   This is limited to the `rmq.instance.metrics` MCP input schema. The Java 
metrics selection and datasource behavior are unchanged.
   
   ## Regression evidence
   
   A deterministic catalog-contract test fails on the current trunk because the 
semantic input is rejected, and passes after the catalog is corrected. The test 
also verifies raw PromQL remains accepted and a missing step is rejected.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to