Aias00 opened a new issue, #4147:
URL: https://github.com/apache/rocketmq-dashboard/issues/4147

   ## Problem
   
   The read-only AI/MCP tool `rmq.message.query` delegates to the non-paged 
`MessageService.queryMessages` path and projects every returned message with 
its full body. A bounded provider scan can still return many messages, and 
message bodies may be large, so one tool call can consume a disproportionate 
amount of the MCP response and LLM context.
   
   The standard REST message endpoint already exposes `queryMessagesPage`, 
including `total`, `page`, `size`, and `resultMayBeTruncated`. The Topic and 
Consumer Group AI tools already use a paged `{items, total, page, size}` 
envelope, but the message tool still returns a raw array.
   
   ## Expected behavior
   
   - Add optional `page` and `pageSize` inputs to `rmq.message.query`.
   - Default to page 1 with 20 items and cap `pageSize` at 100.
   - Delegate to the existing `MessageService.queryMessagesPage` path.
   - Return `{items, total, page, size, resultMayBeTruncated}` so callers can 
distinguish a complete page from a provider-capped result.
   - Add optional `includeBody`, defaulting to `false`.
   - Omit `body`, `bodyEncoding`, and `bodyTruncated` unless 
`includeBody=true`; retain message identity, routing, timestamps, hosts, and 
size.
   - Preserve the existing query filters and L1 read-only permission 
classification.
   
   ## Compatibility
   
   The paged envelope intentionally aligns this tool with `rmq.topic.list` and 
`rmq.group.list`. The canonical output schema and handler must change together 
so schema-driven MCP/CLI clients can render the new contract.
   
   ## Acceptance criteria
   
   - Catalog validation covers the new inputs and paged output metadata.
   - Handler tests prove default paging, custom paging, body omission, explicit 
body inclusion, and truncation metadata.
   - Invalid paging values continue to be rejected through the catalog/service 
validation path.
   - No provider-specific query implementation changes are included.


-- 
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