cpl_search
Find New York Criminal Procedure Law sections by searching full-text terms like 'discovery' or 'speedy trial'. Returns ranked results with citations and titles for further lookup.
Instructions
Full-text search the New York Criminal Procedure Law (CPL) for sections matching a term.
Use this when the user describes a topic rather than naming a section (e.g. "Which CPL sections deal with automatic discovery?", "find CPL provisions about speedy trial"). Returns a ranked list of matching locations with their citation and title. Follow up with cpl_lookup_section to get the full text of a hit.
Args: params (SearchInput): Validated input containing: - term (str): Full-text query, e.g. "automatic discovery", "speedy trial". - limit (Optional[int]): Max results, 1-50 (default 10). - offset (Optional[int]): 1-based start index for pagination (default 1). - response_format (ResponseFormat): "markdown" (default) or "json".
Returns: str: In markdown mode, a numbered list of matches (citation + title + snippet). In json mode, an object with this schema: { "term": str, "total": int, # total matches available "count": int, # results in this page "offset": int, # 1-based offset used "has_more": bool, "next_offset": int|null, "results": [ { "locationId": str, # e.g. "245.20" "title": str, # section title "docType": str, # e.g. "SECTION" "snippet": str, # highlighted match context (may be empty) "sourceUrl": str } ] }
On failure, a string beginning with "Error:".Examples: - Use when: "What CPL sections cover discovery?" -> term="discovery" - Use when: "Find speedy trial rules in the CPL" -> term="speedy trial" - Don't use when: You already know the section number (use cpl_lookup_section).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |