Explore Policy Context
Overview
explore_policy_context retrieves specific chunks from an insurance policy document by their sequential chunk index, given a chunk_group_id. Use this tool when a previously returned policy chunk has incomplete context — for example, it starts mid-sentence, references a section header that isn't visible, or mentions exclusions that continue beyond the chunk boundary. search_insurance_policy (or search_clinical_notes with note_category set to "Insurance Policy") must be called first in the conversation to obtain a valid chunk_group_id; this identifier must never be fabricated or guessed — it must come from a tool result in the current session. A typical usage pattern: if a search result returned chunk_index=57 of total_chunks=130, request start_index=54, end_index=60 to see the surrounding context, checking total_chunks first to avoid requesting out-of-range indices.
Required Parameters
chunk_group_id (string)
- The chunk group identifier from the
metafields of asearch_insurance_policyorsearch_clinical_notesresult.
Optional Parameters
person_id (string)
- Default:
None - The identifier of the person whose policy documents are to be retrieved.
- If not provided, it is extracted from the caller's access token. If it cannot be resolved from either source and elicitation is enabled on the server, the user may be prompted directly for a person ID.
start_index (integer)
- Default:
0 - Inclusive, zero-based start index of the chunk range to retrieve.
end_index (integer)
- Default:
4 - Inclusive, zero-based end index of the chunk range to retrieve.
debug (boolean)
- Default:
False - Whether to display debugging information.
Returns
Returns a PolicyContextOutput with the following fields:
- chunks (array) — sequential chunks from the policy document in reading order, each a note with
note_id,patient_id,text,data_availability_reason,data_availability_message, andmeta. If a chunk's text is unavailable,textcontains an explanatory message instead of clinical content. - chunk_group_id (string) — the chunk group identifier used to retrieve these chunks.
- start_index (integer) — the inclusive start index that was requested.
- end_index (integer) — the inclusive end index that was requested.
- total_chunks (integer, optional) — total number of chunks in this document group, if known.
- truncated (boolean) —
Trueif the requestedend_indexexceededtotal_chunksand the result was capped at the last available chunk.
PolicyContextOutput also inherits common result fields: result (summary text), error (error message, e.g. when no chunks are found for the given chunk_group_id/range), urls, and meta.
Notes
Both start_index and end_index are inclusive and zero-based. If the requested range exceeds the document's total chunk count, the response is truncated to the available chunks and truncated is set to True, with an explanatory message. Relies on a chunk_group_id obtained from search_insurance_policy, search_clinical_notes, or list_available_insurance_docs.
Updated 10 days ago
