Class: Pinmark::Mcp::Tools::ListResolved

Inherits:
MCP::Tool
  • Object
show all
Defined in:
lib/pinmark/mcp/tools/list_resolved.rb

Class Method Summary collapse

Class Method Details

.call(server_context:) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/pinmark/mcp/tools/list_resolved.rb', line 18

def call(server_context:)
  queue = server_context.fetch(:queue)
  resolved = queue.addressed.map do |entry|
    {
      "id" => entry["id"],
      "node_id" => entry["node_id"],
      "component" => entry["component"],
      "source" => entry["source"],
      "selector" => entry["selector"],
      "text_excerpt" => entry["text_excerpt"],
      "comment" => entry["comment"],
      "page_path" => entry["page_path"],
      "captured_at" => entry["captured_at"],
      "addressed_at" => entry["addressed_at"],
      "ancestry" => entry["ancestry"]
    }
  end
  Tools.text_response({ "count" => resolved.size, "annotations" => resolved })
end