Regulation Tools
Tools for researching Title 19 CFR regulations and CBP guidance documents, plus a full customs broker exam workflow.
The tools fall into two groups. Research tools search and browse the regulation corpus: hybrid search, direct section lookup, cross-references, defined terms, semantic connections, and dedicated CBP document search. Exam tools run customs broker exam sessions end to end: list exams, start a session, work through questions one at a time, submit answers, and grade the results.
search_regulations
Search CFR regulations and CBP guidance documents using hybrid vector + full-text search with Reciprocal Rank Fusion reranking.
For specific CBP documents, prefer the dedicated tools: get_entry_rights_directive, search_entry_summary_instructions, and search_entry_summary_business_rules.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | - | Natural language search query (e.g., "tariff classification procedures") |
top_k | integer | No | 10 | Number of results to return |
chapter | string | No | null | Filter by chapter number (e.g., "I") |
part | integer | No | null | Filter by part number (e.g., 10) |
source_type | string | No | null | "ecfr" for regulations only, "cbp_document" for PDFs only |
document_name | string | No | null | Filter by specific document filename |
subpart | string | No | null | Filter by subpart name |
Response
{
"results": [
{
"citation": "19 CFR 152.101",
"section_number": "152.101",
"title": "Basis of appraisement.",
"part_number": 152,
"part_title": "Classification and Appraisement of Merchandise",
"chapter": "I",
"chapter_title": "U.S. Customs and Border Protection",
"subpart": "Subpart E",
"text": "(a) In general. Imported merchandise will be appraised...",
"url": "https://www.ecfr.gov/current/title-19/section-152.101",
"chunk_index": 0,
"score": 0.0328,
"source_type": "ecfr",
"document_name": ""
}
],
"count": 10,
"query": "customs valuation methods"
}Example
{
"query": "customs valuation methods",
"part": 152,
"top_k": 5
}get_regulation_section
Look up a specific CFR section by number. Returns the full section text with metadata.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
section | string | Yes | - | Section number in any format: "10.31", "19 CFR 10.31", "§ 10.31" |
Response
{
"citation": "19 CFR 10.31",
"section_number": "10.31",
"title": "Entry; bond.",
"part_number": 10,
"part_title": "Articles Conditionally Free, Subject to a Reduced Rate, etc.",
"chapter": "I",
"chapter_title": "U.S. Customs and Border Protection",
"subpart": "Subpart A",
"authority": "19 U.S.C. 66, 1202...",
"source": "T.D. 94-51, 59 FR 30294...",
"text": "(a) Entry of articles brought into the United States temporarily...",
"url": "https://www.ecfr.gov/current/title-19/section-10.31",
"total_chunks": 4
}Example
{
"section": "19 CFR 10.31"
}list_regulation_sections
Browse regulation sections with optional chapter or part filtering. Results are sorted in section-number order.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
chapter | string | No | null | Filter by chapter (e.g., "I", "II", "III") |
part | integer | No | null | Filter by part number (e.g., 10, 19, 141) |
limit | integer | No | 100 | Maximum sections to return |
Response
{
"sections": [
{
"citation": "19 CFR 141.1",
"section_number": "141.1",
"title": "Liability of importer for duties.",
"part_number": 141,
"part_title": "Entry of Merchandise",
"chapter": "I"
}
],
"count": 62
}Example
{
"part": 141
}get_regulation_structure
Get the full chapter, part, and section hierarchy for the CFR title. Takes no parameters.
Response
{
"title": "Title 19",
"chapters": [
{
"chapter": "I",
"title": "U.S. Customs and Border Protection",
"parts": [
{
"part_number": 10,
"title": "Articles Conditionally Free, Subject to a Reduced Rate, etc.",
"section_count": 312,
"sections": [
{ "section_number": "10.1", "title": "Domestic products; requirements on entry." }
]
}
]
}
]
}Example
{}get_regulation_cross_references
Get cross-references for a CFR section: the sections, parts, and U.S.C. provisions it cites (outbound) and the sections that cite it (inbound). Each reference includes the surrounding sentence context.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
section | string | Yes | - | Section number (e.g., "111.16") |
direction | string | No | "both" | "outbound", "inbound", or "both" |
Reference types: cfr_section (a section in the database), cfr_external (a CFR section outside the ingested title), cfr_part (a whole part), and usc (a U.S. Code citation).
Response
{
"outbound": [
{
"target_section": "111.1",
"target_raw": "§ 111.1",
"reference_type": "cfr_section",
"target_part": 111,
"context": "As defined in § 111.1, a broker must exercise responsible supervision and control...",
"target_title": "Definitions."
}
],
"inbound": [
{
"source_section": "111.19",
"target_raw": "§ 111.16",
"reference_type": "cfr_section",
"target_part": 111,
"context": "...subject to the provisions of § 111.16 regarding continuing obligations.",
"source_title": "Districts and district permits."
}
]
}Example
{
"section": "111.16",
"direction": "both"
}resolve_regulation_definitions
Resolve all defined terms relevant to a CFR section. Searches definitions from the section’s own part, any applicable subpart definitions, and the master definitions in 101.1. Only returns terms that actually appear in the section text, with the most specific scope winning per term.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
section | string | Yes | - | Section number (e.g., "141.37") |
Response
{
"definitions": [
{
"term": "entry",
"display_term": "Entry",
"definition": "the documentation required to be filed with the appropriate CBP officer...",
"source_section": "141.0a",
"scope": "part"
}
],
"count": 6,
"section": "141.37"
}Example
{
"section": "141.37"
}search_regulation_definitions
Search defined terms across all CFR definition sections. Use this to look up a term directly or browse definitions for a specific part. For definitions scoped to a specific section’s context, use resolve_regulation_definitions instead.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
term | string | No | null | Substring to match against defined terms (case-insensitive) |
part | integer | No | null | Filter by part number (e.g., 190 for drawback definitions) |
scope | string | No | null | Filter by scope level: "general", "part", or "subpart" |
limit | integer | No | 50 | Maximum results |
Response
{
"definitions": [
{
"term": "drawback",
"display_term": "Drawback",
"definition": "the refund or remission, in whole or in part, of duties, taxes, and fees...",
"source_section": "190.2",
"scope": "part"
}
],
"count": 3
}Example
{
"term": "drawback",
"part": 190
}get_related_regulation_sections
Get semantically related CFR sections. Uses pre-computed semantic similarity plus LLM classification to find sections that are commonly confused with, complementary to, prerequisite for, or exceptions to the given section.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
section | string | Yes | - | Section number (e.g., "111.13") |
relationship_type | string | No | null | Filter: "commonly_confused", "complementary", "prerequisite", or "exception" |
limit | integer | No | 10 | Maximum results |
Response
{
"related": [
{
"related_section": "111.11",
"relationship_type": "prerequisite",
"score": 0.89,
"explanation": "Basic requirements for a broker license must be met before examination.",
"related_title": "Basic requirements for a license."
}
],
"count": 5,
"section": "111.13"
}Example
{
"section": "111.13",
"relationship_type": "commonly_confused"
}get_regulation_context
Get full regulatory context for a CFR section in a single call. Combines the section text, cross-references, scoped definitions, and semantically related sections into one comprehensive response.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
section | string | Yes | - | Section number (e.g., "141.37") |
depth | integer | No | 1 | 1 = direct context only, 2 = also follow up to 5 outbound refs one hop |
include_related | boolean | No | true | Whether to include semantic connections |
Response
{
"section": {
"citation": "19 CFR 141.37",
"section_number": "141.37",
"title": "Additional requirements for power of attorney for certain classes.",
"text": "...",
"total_chunks": 2
},
"cross_references": {
"outbound": [],
"inbound": []
},
"definitions": [
{
"term": "entry",
"display_term": "Entry",
"definition": "the documentation required...",
"source_section": "141.0a",
"scope": "part"
}
],
"related_sections": [
{
"related_section": "141.36",
"relationship_type": "complementary",
"score": 0.91,
"explanation": "Both govern power of attorney requirements for entry.",
"related_title": "Nonresident principals in general."
}
]
}With depth: 2, the response adds a depth_2 object keyed by target section number, each entry containing that section’s text, outbound cross-references, and definitions.
Example
{
"section": "141.37",
"depth": 2
}get_entry_rights_directive
Get the full text of CBP Directive 3530-002A: Right to Make Entry. This directive defines who may make entry of imported merchandise under 19 CFR Part 141. Returns the entire document. Takes no parameters.
Response
{
"document_name": "3530-002A.pdf",
"citation": "CBP Directive 3530-002A",
"title": "CBP Directive 3530-002A: Right to Make Entry",
"source_type": "cbp_document",
"text": "RIGHT TO MAKE ENTRY. 1. PURPOSE. To provide guidance...",
"total_chunks": 18
}Example
{}search_entry_summary_instructions
Search the ACE Entry Summary (ES) Instructions document. Covers filing procedures, data element definitions, and submission requirements for ACE Entry Summary (CBP Form 7501 equivalent).
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | - | Natural language search query (e.g., "bond amount", "entry type 01") |
top_k | integer | No | 10 | Number of results to return |
Response
Same shape as search_regulations: a results array of scored chunks with source_type: "cbp_document" and the ES Instructions document_name, plus count and query.
{
"results": [
{
"citation": "",
"section_number": "",
"title": "ACE Entry Summary Instructions",
"text": "Block 23: Importer Number. Record the IRS EIN, SSN, or CBP assigned number...",
"chunk_index": 41,
"score": 0.0325,
"source_type": "cbp_document",
"document_name": "ACE-Entry-Summary-Instructions.pdf"
}
],
"count": 10,
"query": "importer number"
}Example
{
"query": "entry type 01",
"top_k": 5
}search_entry_summary_business_rules
Search the ACE Entry Summary Business Process (ESBP) document. Covers validation rules, processing logic, MPF/HMF calculations, duty computations, and CBP acceptance/rejection criteria for entry summaries.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | - | Natural language search query (e.g., "MPF validation", "AD/CVD deposit") |
top_k | integer | No | 10 | Number of results to return |
Response
Same shape as search_regulations: a results array of scored chunks from the ESBP document, plus count and query.
Example
{
"query": "MPF validation"
}Exam workflow
The broker exam tools run a complete exam session. Use them in this order:
list_regulation_examsto see available examsstart_regulation_examto create a session and get asession_idget_regulation_exam_questionsto fetch the questions (correct answers are never exposed)- For each question:
start_regulation_question, then research with the tools above, thensubmit_regulation_exam_answer get_regulation_exam_progressto check completion at any pointgrade_regulation_examto score the session against the answer keyget_regulation_exam_resultsfor per-question detail including the research trail
All research tool calls made between start_regulation_question and submit_regulation_exam_answer are recorded as that question’s research trail.
list_regulation_exams
List available customs broker exams with question counts per category. Takes no parameters.
Response
{
"exams": [
{
"exam_id": "april-2025",
"total_questions": 80,
"answers_loaded": 80,
"by_category": {
"Classification": 20,
"Entry": 15,
"Valuation": 10
}
}
],
"count": 1
}Example
{}start_regulation_exam
Start a new exam session for a customs broker exam.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
exam_id | string | Yes | - | Exam identifier (e.g., "april-2025"). Use list_regulation_exams to see available exams |
model_name | string | No | null | Optional model/strategy label for tracking runs |
Response
{
"session_id": "9f4c1e2a-7b3d-4a8e-9c6f-2d1e8b7a5c3f",
"exam_id": "april-2025",
"model_name": null,
"started_at": "2026-07-15T14:02:11.482910",
"total_questions": 80
}Example
{
"exam_id": "april-2025"
}get_regulation_exam_questions
Get questions for an exam session. Does not reveal correct answers. Work through questions one at a time: call start_regulation_question, research, then submit_regulation_exam_answer.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session_id | string | Yes | - | Session UUID from start_regulation_exam |
category | string | No | null | Optional category filter (e.g., "Classification", "Valuation") |
Response
{
"questions": [
{
"id": 101,
"question_number": 1,
"exam_id": "april-2025",
"category": "Entry",
"question_text": "Which of the following parties has the right to make entry?",
"choices": {
"A": "A licensed customs broker with a valid power of attorney",
"B": "Any freight forwarder",
"C": "The carrier",
"D": "Any person with knowledge of the shipment"
}
}
],
"count": 80
}Example
{
"session_id": "9f4c1e2a-7b3d-4a8e-9c6f-2d1e8b7a5c3f"
}start_regulation_question
Begin working on a specific exam question. Call this before researching: it sets the active question context so subsequent research tool calls are recorded for this question. Returns the question detail.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session_id | string | Yes | - | Session UUID from start_regulation_exam |
question_id | integer | Yes | - | Question ID from get_regulation_exam_questions |
Response
{
"id": 101,
"question_number": 1,
"exam_id": "april-2025",
"category": "Entry",
"question_text": "Which of the following parties has the right to make entry?",
"choices": {
"A": "A licensed customs broker with a valid power of attorney",
"B": "Any freight forwarder",
"C": "The carrier",
"D": "Any person with knowledge of the shipment"
}
}Example
{
"session_id": "9f4c1e2a-7b3d-4a8e-9c6f-2d1e8b7a5c3f",
"question_id": 101
}submit_regulation_exam_answer
Submit an answer for the current question and close its research context. Resubmitting for the same question updates the existing answer.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session_id | string | Yes | - | Session UUID from start_regulation_exam |
question_id | integer | Yes | - | Question ID from get_regulation_exam_questions |
answer | string | Yes | - | Must be "A", "B", "C", or "D" |
reasoning | string | No | null | Optional explanation of the reasoning |
citations | array of strings | No | null | Optional CFR sections or document references used |
Response
{
"answer_id": "c2b7a4d1-3e8f-4b6a-9d2c-7f1e5a8b3c4d",
"session_id": "9f4c1e2a-7b3d-4a8e-9c6f-2d1e8b7a5c3f",
"question_id": 101,
"answer": "A",
"answered_at": "2026-07-15T14:07:45.128733"
}Example
{
"session_id": "9f4c1e2a-7b3d-4a8e-9c6f-2d1e8b7a5c3f",
"question_id": 101,
"answer": "A",
"reasoning": "19 CFR 141.31 and CBP Directive 3530-002A limit the right to make entry.",
"citations": ["141.31", "CBP Directive 3530-002A"]
}get_regulation_exam_progress
Check progress for an exam session: how many questions are answered, overall and by category.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session_id | string | Yes | - | Session UUID from start_regulation_exam |
Response
{
"session_id": "9f4c1e2a-7b3d-4a8e-9c6f-2d1e8b7a5c3f",
"exam_id": "april-2025",
"answered": 34,
"total": 80,
"pct": 42.5,
"by_category": {
"Classification": { "total": 20, "answered": 12 },
"Entry": { "total": 15, "answered": 15 }
}
}Example
{
"session_id": "9f4c1e2a-7b3d-4a8e-9c6f-2d1e8b7a5c3f"
}grade_regulation_exam
Grade all submitted answers in an exam session against the answer key. Requires a complete answer key for the exam; grading fails if any question lacks a correct_answer.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session_id | string | Yes | - | Session UUID from start_regulation_exam |
Response
{
"session_id": "9f4c1e2a-7b3d-4a8e-9c6f-2d1e8b7a5c3f",
"score": {
"total": 80,
"correct": 66,
"pct": 82.5,
"by_category": {
"Classification": { "total": 20, "correct": 16, "pct": 80.0 },
"Entry": { "total": 15, "correct": 14, "pct": 93.3 }
}
}
}Example
{
"session_id": "9f4c1e2a-7b3d-4a8e-9c6f-2d1e8b7a5c3f"
}get_regulation_exam_results
Get full graded results for an exam session: the session summary with score, plus per-question detail including the submitted answer, correct answer, reasoning, citations, and the research trail of tool calls made while working the question.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session_id | string | Yes | - | Session UUID from start_regulation_exam |
Response
{
"session": {
"id": "9f4c1e2a-7b3d-4a8e-9c6f-2d1e8b7a5c3f",
"exam_id": "april-2025",
"model_name": null,
"started_at": "2026-07-15T14:02:11.482910",
"completed_at": "2026-07-15T16:48:03.201554",
"graded_at": "2026-07-15T16:48:03.201554",
"score": { "total": 80, "correct": 66, "pct": 82.5 }
},
"questions": [
{
"question_id": 101,
"question_number": 1,
"category": "Entry",
"question_text": "Which of the following parties has the right to make entry?",
"choices": { "A": "...", "B": "...", "C": "...", "D": "..." },
"correct_answer": "A",
"submitted_answer": "A",
"is_correct": true,
"reasoning": "19 CFR 141.31 and CBP Directive 3530-002A limit the right to make entry.",
"citations": ["141.31", "CBP Directive 3530-002A"],
"research_trail": [
{
"tool_name": "search_regulations",
"arguments": { "query": "right to make entry", "part": 141 },
"result_summary": "10 results",
"duration_ms": 412,
"called_at": "2026-07-15T14:05:32.884120"
}
]
}
]
}Example
{
"session_id": "9f4c1e2a-7b3d-4a8e-9c6f-2d1e8b7a5c3f"
}Administrative tools
The server also registers pipeline and status tools used to build and maintain the regulation database. These are operational, not research tools:
| Tool | Purpose |
|---|---|
ingest_regulations | Fetch and ingest CFR regulations from the eCFR API (parses sections, chunks text, generates embeddings) |
ingest_regulation_pdf | Ingest a PDF file or directory of PDFs into the regulation search database |
build_regulation_intelligence | Extract cross-references, definitions, and semantic connections for all sections |
fix_regulation_subparts | Populate the subpart column from the official eCFR structure hierarchy |
list_regulation_documents | List all ingested PDF/CBP guidance documents with chunk counts |
get_regulation_status | Database stats: section count, chunk count, parts, chapters, document count |