# Gem Document Processing API

> Extract contract numbers, GSTINs, and totals from procurement PDFs and images using a local tool on your computer.

Gem Document Processing API is a free AI agent skill on Agensi by Vidhi Bhatnagar, in APIs & Backend. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Vidhi Bhatnagar](https://www.agensi.io/creators/vidhi-bhatnagar)
- Category: [APIs & Backend](https://www.agensi.io/skills/apis-backend)
- Version: 1.0
- Last updated: 2026-12-05
- Security: scan passed (2026-12-05); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/gem-document-processing-api
- Tags: api, java, ocr, procurement, tesseract

## What it does

- Reads contract numbers and dates from procurement PDFs and images
- Extracts seller GSTIN identifiers and grand totals automatically
- Processes files locally on your computer to keep your data private
- Converts document images into structured data you can easily read
- Uses text recognition to handle JPG and PNG photos of documents

## Who it's for

- **Government vendors using the GeM portal:** Quickly pull contract numbers and totals from your procurement documents. Try: "Extract the details from this GeM contract PDF."
- **Accountants processing procurement invoices:** Get seller GSTINs and totals into a structured format without typing them in manually. Try: "Process these JPG scans of my procurement receipts."
- **Small business owners tracking government orders:** Turn messy document text into organized data you can check and save. Try: "Read this procurement document and tell me the grand total and date."

## About this skill

If you handle government procurement documents, manually copying contract numbers, GSTINs and totals can be time-consuming. This skill connects an AI agent to a locally running Java application that extracts important information from procurement documents.

### How it works

1. Start the Java Spring Boot helper application on your computer.
2. Provide your AI agent with a procurement PDF or JPG/PNG image.
3. The agent sends the document to your local processing endpoint.
4. The application extracts relevant information and returns structured JSON.

### Frameworks and Technologies

- Java 21
- Spring Boot
- Apache PDFBox
- Tess4J / Tesseract OCR
- REST API
- JSON

### Supported Documents

- Text-based PDF documents.
- JPG images.
- PNG images.

### Extracted Information

- Document type
- Contract number
- Date
- Seller GSTIN
- Grand total

### Use Cases

- Extracting contract information from GeM procurement documents.
- Identifying seller GSTINs from procurement records.
- Reading totals from scanned JPG and PNG documents.
- Converting extracted information into structured JSON.

### Known Limitations

- Scanned PDFs are not currently supported.
- Extraction is pattern-based and may occasionally identify incorrect values.
- Always verify extracted information against the original document.
- The local Spring Boot helper application must be running before the skill can process documents.

## Technical details

This skill interfaces with a Java 21 / Spring Boot 3.2.3 REST API. It uses Apache PDFBox for text-based PDF extraction and Tess4J (Tesseract) for JPG/PNG OCR. The agent communicates with the local endpoint at http://localhost:8080/api/v1/gem/process using multipart/form-data. Users must have JDK 21, Maven, and Tesseract OCR installed locally. The API returns a JSON object containing documentType, contractNumber, date, sellerGstin, and grandTotal.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Gem Document Processing API skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this help me with my procurement documents?

This skill connects your AI agent to a local tool that reads procurement documents and automatically extracts the contract number, seller GSTIN, date, and total price for you.

### What software do I need to have on my computer to use this?

You need to have Java 21, Maven, and Tesseract OCR installed on your computer to run the helper application. Once the local tool is running, your AI agent can send files to it for processing.

### What types of files can I process with this?

The skill works with text-based PDF files and common image formats like JPG, JPEG, and PNG. It cannot read text from scanned PDFs that do not already have a text layer.

### What specific information will I get back after a file is read?

You will receive a structured data list containing the document type, contract number, date, seller GSTIN, and the grand total price. The information is returned in a format that your AI agent can easily read and summarize.

### Can I rely on the extracted numbers for official payments?

Because the extraction uses patterns to guess the correct fields, you must always double-check the results against the original document. You should not use the extracted numbers for legal or payment decisions without a human verifying them first.

### How do I tell my AI agent to start reading my files?

You can simply tell your agent to process a specific procurement PDF or image using your local tool. Be sure to provide the file and confirm that your local helper application is already running on your machine.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
