Home/Tools/@tpmjs/tools-invoice-data-extract

invoiceDataExtractTool

@tpmjs/tools-invoice-data-extract

Extracts structured data from invoice text content. Parses vendor information, invoice metadata (number, date), line items with quantities and prices, subtotal, tax, and total. Validates that totals match line items and provides warnings for any discrepancies. Useful for automated invoice processing and data entry.

Official
finance
v0.1.0
MIT

Interactive Playground

Test @tpmjs/tools-invoice-data-extract (invoiceDataExtractTool) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @tpmjs/tools-invoice-data-extract
pnpm add @tpmjs/tools-invoice-data-extract
yarn add @tpmjs/tools-invoice-data-extract
bun add @tpmjs/tools-invoice-data-extract
deno add npm:@tpmjs/tools-invoice-data-extract

2. Import the tool

import { invoiceDataExtractTool } from '@tpmjs/tools-invoice-data-extract';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { invoiceDataExtractTool } from '@tpmjs/tools-invoice-data-extract';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { invoiceDataExtractTool },
  prompt: 'Your prompt here...',
});

console.log(result.text);

Signature

(invoiceText: string) => Promise<unknown>

Tags

accounting
content
data
data-extraction
extract
extracts
finance
information
invoice
parses
structured
text
tpmjs
vendor

Parameters

Available configuration options

Auto-extracted
invoiceText
Required
Type: string

Full text content of the invoice (from OCR, PDF extraction, or manual input)

Schema extracted: 3/1/2026, 4:28:18 AM

README

ERROR: No README data found!

Statistics

Downloads/month

5

GitHub Stars

0

Quality Score

72%

Bundle Size

NPM Keywords

tpmjs
finance
invoice
accounting
data-extraction

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai