This commit is contained in:
Jorge Manrubia
2025-11-03 07:16:11 +01:00
parent 9caf39ad2c
commit bfc0b75e6c
-12
View File
@@ -1,12 +0,0 @@
module McpHelper
def parse_paginated_response(response)
records_match = response.match(/Records:\n```\n(\[.*\])\n```/m)
assert records_match, "Could not find any records in the paginated response"
records = JSON.parse(records_match[1])
next_param_match = response.match(/next page:\n```\n(\[.*\])\n```/m)
next_param = next_param_match[1] if next_param_match
{ records: records, next_param: next_param }
end
end