Skip to main content

parse_cite_batch

Function parse_cite_batch 

Source
pub fn parse_cite_batch(params: &Value) -> Option<(String, Vec<String>)>
Expand description

Convenience helper used by the MCP store/link consume hook: read the recall_id + cited_memory_ids array out of an MCP request params Value. Both must be present for a cite-batch to fire.

Accepts the following shapes under params:

  • { "recall_id": "...", "cited_memory_ids": ["...", "..."] }
  • { "consumed_from_recall_id": "...", "cited_memory_ids": [...] } (alternate field name some clients prefer for readability)

Returns None when either field is missing or the recall_id is empty / whitespace. Returns Some((recall_id, ids)) otherwise; ids are unique-preserving over the source array.