Skip to main content
Glama

parse_prescription

Extract structured data from prescription PDFs using a local Ollama model, including patient, doctor, medications, and notes.

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 download_document). 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNollama3.2
file_pathYes
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It describes the two-step process (PDF text extraction and Ollama model extraction) and the fallback to vision mode. It also lists the return structure, but does not disclose potential side effects, prerequisites like Ollama being installed, or error handling behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear one-line summary, a brief process explanation, and an Args list. No redundant information; every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given there is no output schema, the description accurately lists the full return dict fields. It also explains the input source and model options. It is complete for an agent to understand invocation, though it could mention failure scenarios.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description includes an Args section that explains both parameters beyond the schema, noting file_path is the path from download_document and recommending vision models for image-based PDFs. Since schema coverage is 0%, this fully compensates.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool parses a downloaded prescription PDF, with a specific verb ('Parse') and resource, and distinguishes it from sibling tools like download_document and get_document_content by focusing on structured extraction via a local Ollama model.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides context on when to use the tool (after downloading a prescription PDF) and gives guidance on model selection for image-based PDFs. However, it does not explicitly mention alternatives or when not to use it, making it clear but not fully explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nathanfolkman/jcs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server