Skip to content
Skillpedia
Agents48k · #2271

azure-ai-document-intelligence-ts

Helps your agent read and understand information in documents. It's useful for pulling key data from files like PDFs or images. This makes it easier to organize and use the information found in those documents.

What it does

This tool extracts important information from documents, such as text, tables, and structured data. It can understand different document types, like invoices and receipts, or even be trained to understand custom documents.

When to use it

  • ✓When you need to automatically extract data from invoices and receipts.
  • ✓To organize and search for information in large volumes of documents.
  • ✓When creating a system that needs to understand the content of specific documents.

Example of what to ask your AI

“Extract the invoice data from this link: [invoice link]”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-document-intelligence-ts/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-document-intelligence-ts/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

You send a document (via link or file) to the tool. It uses pre-trained or custom models to identify and extract the information you need, such as amounts, dates, and names.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill azure-ai-document-intelligence-ts

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/azure-ai-document-intelligence-ts/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Azure Document Intelligence REST SDK for TypeScript

Extract text, tables, and structured data from documents using prebuilt and custom models.

Installation

npm install @azure-rest/ai-document-intelligence @azure/identity

Environment Variables

DOCUMENT_INTELLIGENCE_ENDPOINT=https://<resource>.cognitiveservices.azure.com
DOCUMENT_INTELLIGENCE_API_KEY=<api-key>

Authentication

Important: This is a REST client. DocumentIntelligence is a function, not a class.

DefaultAzureCredential

import DocumentIntelligence from "@azure-rest/ai-document-intelligence";
import { DefaultAzureCredential } from "@azure/identity";

const client = DocumentIntelligence(
  process.env.DOCUMENT_INTELLIGENCE_ENDPOINT!,
  new DefaultAzureCredential()
);

API Key

import DocumentIntelligence from "@azure-rest/ai-document-intelligence";

const client = DocumentIntelligence(
  process.env.DOCUMENT_INTELLIGENCE_ENDPOINT!,
  { key: process.env.DOCUMENT_INTELLIGENCE_API_KEY! }
);

Analyze Document https://example.com

import DocumentIntelligence, {
  isUnexpected,
  getLongRunningPoller,
  AnalyzeOperationOutput
} from "@azure-rest/ai-document-intelligence";

const initialResponse = await client
  .path("/documentModels/{modelId}:analyze", "prebuilt-layout")
  .post({
    contentType: "application/json",
    body: {
      urlSource: "https://example.com/document.pdf"
    },
    queryParameters: { locale: "en-US" }
  });

if (isUnexpected(initialResponse)) {
  throw initialResponse.body.error;
}

const poller = getLongRunningPoller(client, initialResponse);
const result = (await poller.pollUntilDone()).body as AnalyzeOperationOutput;

console.log("Pages:", result.analyzeResult?.pages?.length);
console.log("Tables:", result.analyzeResult?.tables?.length);

Analyze Document (Local File)

import { readFile } from "node:fs/promises";

const fileBuffer = await readFile("./document.pdf");
const base64Source = fileBuffer.toString("base64");

const initialResponse = await client
  .path("/documentModels/{modelId}:analyze", "prebuilt-invoice")
  .post({
    contentType: "application/json",
    body: { base64Source }
  });

if (isUnexpected(initialResponse)) {
  throw initialResponse.body.error;
}

const poller = getLongRunningPoller(client, initialResponse);
const result = (await poller.pollUntilDone()).body as AnalyzeOperationOutput;

Prebuilt Models

Model ID Description
prebuilt-read OCR - text and language extraction
prebuilt-layout Text, tables, selection marks, structure
prebuilt-invoice Invoice fields
prebuilt-receipt Receipt fields
prebuilt-idDocument ID document fields
prebuilt-tax.us.w2 W-2 tax form fields
prebuilt-healthInsuranceCard.us Health insurance card fields
prebuilt-contract Contract fields
prebuilt-bankStatement.us Bank statement fields

Extract Invoice Fields

const initialResponse = await client
  .path("/documentModels/{modelId}:analyze", "prebuilt-invoice")
  .post({
    contentType: "application/json",
    body: { urlSource: invoiceUrl }
  });

if (isUnexpected(initialResponse)) {
  throw initialResponse.body.error;
}

const poller = getLongRunningPoller(client, initialResponse);
const result = (await poller.pollUntilDone()).body as AnalyzeOperationOutput;

const invoice = result.analyzeResult?.documents?.[0];
if (invoice) {
  console.log("Vendor:", invoice.fields?.VendorName?.content);
  console.log("Total:", invoice.fields?.InvoiceTotal?.content);
  console.log("Due Date:", invoice.fields?.DueDate?.content);
}

Extract Receipt Fields

const initialResponse = await client
  .path("/documentModels/{modelId}:analyze", "prebuilt-receipt")
  .post({
    contentType: "application/json",
    body: { urlSource: receiptUrl }
  });

const poller = getLongRunningPoller(client, initialResponse);
const result = (await poller.pollUntilDone()).body as AnalyzeOperationOutput;

const receipt = result.analyzeResult?.documents?.[0];
if (receipt) {
  console.log("Merchant:", receipt.fields?.MerchantName?.content);
  console.log("Total:", receipt.fields?.Total?.content);
  
  for (const item of receipt.fields?.Items?.values || []) {
    console.log("Item:", item.properties?.Description?.content);
    console.log("Price:", item.properties?.TotalPrice?.content);
  }
}

…

FAQ

What types of documents can I process?

You can process various document types, including invoices, receipts, ID documents, health insurance cards, contracts, and tax forms. The tool can also be trained to understand custom documents.

How does the tool know what to extract?

It uses artificial intelligence models. Some models are ready to understand common document types (like invoices), and others can be trained with your own examples to extract specific information.

Do I need to know how to code to use it?

The tool itself is a programming service, but you can use it through interfaces or tools that simplify the process, without needing to write complex code.

Details

Original description by the author

Extract text, tables, and structured data from documents using prebuilt and custom models.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#2271
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills