Class: Pgbus::MCP::Tools::DlqTool
- Defined in:
- lib/pgbus/mcp/tools/dlq_tool.rb
Overview
Paginated dead-letter queue inspection across all *_dlq queues. Maps to DataSource#dlq_messages. Payloads redacted by default.
Constant Summary collapse
- MAX_PER_PAGE =
100- MAX_PAGE =
1_000
Class Method Summary collapse
Methods inherited from BaseTool
annotations_value, data_source_from, error_response, json_response, payloads_allowed?
Class Method Details
.call(page: 1, per_page: 25, include_payloads: false, server_context: nil) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/pgbus/mcp/tools/dlq_tool.rb', line 33 def self.call(page: 1, per_page: 25, include_payloads: false, server_context: nil) data_source = data_source_from(server_context) per_page = per_page.to_i.clamp(1, MAX_PER_PAGE) page = page.to_i.clamp(1, MAX_PAGE) rows = data_source.(page: page, per_page: per_page) json_response( { page: page, per_page: per_page, messages: rows }, server_context: server_context, include_payloads: include_payloads ) end |