Count Sections in a Scope
count_statute_sectionsCount statute sections in a jurisdiction, corpus, code, title, chapter or part, or count Boolean matches, to size a job before walking divisions or paging a search.
Instructions
Exact section count for a jurisdiction, corpus, code, title, chapter or part, or the number of sections matching a Boolean expression (query with matchType boolean, syntax as search_us_statutes). Use to size a job before walking divisions or paging a Boolean search. A natural-language question cannot be counted. isExact false means an upper bound (phrases, proximity, or filters beyond corpusType, state and status). A zero count may indicate a wrong filter.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "count_statute_sections"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | State code identifier, e.g. `tx_26`. With `corpusType=FEDERAL_RULES`, a rule set instead (`frcp`, `uscapp_t28a_fre`). Same values and checks as `code` on `/search`. | |
| part | No | CFR part identifier. Pair with `titleNumber`. | |
| query | No | A Boolean expression to count, with matchType `boolean` (syntax as on search_us_statutes). Omit to count the whole scope. A natural-language question cannot be counted: rank it with search_us_statutes. | |
| state | No | Two-letter jurisdiction code or `federal`, single or list. | |
| article | No | Article label (`Amendment XIV`) on CONSTITUTION / STATE_CONSTITUTION, or article number (`2-A`) on a STATE / REGULATION code divided by article. Same values and pairing rules as `article` on `/search`. | |
| chapter | No | Chapter identifier. Pair with `titleNumber` or `code`. | |
| actStatus | No | Count only sections carrying this status. | |
| matchType | No | `"boolean"` to count the sections satisfying `query`. Required with `query`. | |
| corpusType | No | Corpus to count, single or list. Omit to count every corpus. | |
| titleNumber | No | USC or CFR title number. | |
| Idempotency-Key | No | Optional, 16 to 255 visible ASCII characters (a UUIDv4 is ideal). A retry with the same key and request replays the original 2xx for 24 hours without charging again; the same key with a different request is rejected. | |
| excludeRepealed | No | Only sections with an affirmatively dead status are excluded. Sections with no recorded status are kept. US Code uses a stored annual edition, so sections repealed after that edition closed are still counted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||