Get PDF Page Count
get_page_countRetrieve the total page count of a PDF by reading only its header, enabling fast validation and extraction planning without loading the full file.
Instructions
Get the total number of pages in a PDF document.
This is a lightweight operation that only reads the PDF header, not the full content.
Args:
file_path (string): Absolute path to a local PDF file
Returns: Page count as a number.
Examples:
Quick check before deciding which pages to extract
Validate a PDF file is readable
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>"
},
"name": "get_page_count"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to a local PDF file (e.g., "/path/to/document.pdf") |