parse_prescription
Extract structured prescription data from a downloaded PDF using a local Ollama model. Handles both text-based and image-based PDFs to return patient, medication, and prescription details.
Instructions
Parse a downloaded prescription PDF with a local Ollama model.
Extracts text from the PDF and sends it to a local Ollama model for structured extraction. Falls back to vision-mode (image rendering) for image-based PDFs.
Args: file_path: Path to the prescription PDF (from get_prescription). model: Ollama model ID to use (default: "llama3.2"; use a vision model like "llava" if the PDF is image-based).
Returns structured dict with: patient, date, doctor, specialty, medications (list with name/dci/strength/form/quantity/posology/duration), prescription_number, notes.
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": "parse_prescription"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | llama3.2 | |
| file_path | Yes |