@talonic/docs 0.20.1 → 0.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/content.d.ts +9 -1
- package/dist/content.js +1148 -34
- package/dist/index.d.ts +13 -1
- package/dist/index.js +89 -0
- package/dist/index.js.map +1 -1
- package/dist/seo.d.ts +13 -1
- package/dist/seo.js +90 -1
- package/package.json +1 -1
package/dist/content.js
CHANGED
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
// src/content/helpers.ts
|
|
2
|
-
function deriveBreadcrumbs(
|
|
2
|
+
function deriveBreadcrumbs(sections47, leafId, domain) {
|
|
3
|
+
const domainLabels = {
|
|
4
|
+
api: "API Reference",
|
|
5
|
+
platform: "Platform Guide",
|
|
6
|
+
sdk: "Node SDK",
|
|
7
|
+
mcp: "MCP Server"
|
|
8
|
+
};
|
|
3
9
|
const root = {
|
|
4
|
-
label: domain
|
|
10
|
+
label: domainLabels[domain] ?? domain,
|
|
5
11
|
slug: domain
|
|
6
12
|
};
|
|
7
|
-
for (const group of
|
|
13
|
+
for (const group of sections47) {
|
|
8
14
|
const child = group.children?.find((c) => c.id === leafId);
|
|
9
15
|
if (child) {
|
|
10
16
|
return [root, { label: group.label, slug: group.id }, { label: child.label, slug: child.id }];
|
|
11
17
|
}
|
|
12
18
|
}
|
|
13
|
-
const topLevel =
|
|
19
|
+
const topLevel = sections47.find((s) => s.id === leafId);
|
|
14
20
|
if (topLevel) {
|
|
15
21
|
return [root, { label: topLevel.label, slug: topLevel.id }];
|
|
16
22
|
}
|
|
17
23
|
return [root];
|
|
18
24
|
}
|
|
19
|
-
function derivePrevNext(
|
|
20
|
-
const flat =
|
|
25
|
+
function derivePrevNext(sections47, leafId) {
|
|
26
|
+
const flat = sections47.flatMap(
|
|
21
27
|
(s) => s.children ?? [{ id: s.id, label: s.label }]
|
|
22
28
|
);
|
|
23
29
|
const idx = flat.findIndex((c) => c.id === leafId);
|
|
@@ -347,6 +353,63 @@ var PLATFORM_NAV_SECTIONS = [
|
|
|
347
353
|
{ id: "shortcuts", label: "Keyboard Shortcuts" }
|
|
348
354
|
] }
|
|
349
355
|
];
|
|
356
|
+
var SDK_NAV_SECTIONS = [
|
|
357
|
+
{ id: "sdk-overview", label: "Overview", children: [
|
|
358
|
+
{ id: "sdk-introduction", label: "Introduction" },
|
|
359
|
+
{ id: "sdk-installation", label: "Installation" },
|
|
360
|
+
{ id: "sdk-authentication", label: "Authentication" },
|
|
361
|
+
{ id: "sdk-quickstart", label: "Quick Start" }
|
|
362
|
+
] },
|
|
363
|
+
{ id: "sdk-client", label: "Client", children: [
|
|
364
|
+
{ id: "sdk-configuration", label: "Configuration" },
|
|
365
|
+
{ id: "sdk-extract", label: "Extract" }
|
|
366
|
+
] },
|
|
367
|
+
{ id: "sdk-resources", label: "Resources", children: [
|
|
368
|
+
{ id: "sdk-documents", label: "Documents" },
|
|
369
|
+
{ id: "sdk-extractions", label: "Extractions" },
|
|
370
|
+
{ id: "sdk-schemas", label: "Schemas" },
|
|
371
|
+
{ id: "sdk-jobs", label: "Jobs" }
|
|
372
|
+
] },
|
|
373
|
+
{ id: "sdk-cli", label: "CLI", children: [
|
|
374
|
+
{ id: "sdk-cli-usage", label: "Usage" }
|
|
375
|
+
] },
|
|
376
|
+
{ id: "sdk-errors", label: "Error Handling", children: [
|
|
377
|
+
{ id: "sdk-error-classes", label: "Error Classes" },
|
|
378
|
+
{ id: "sdk-retries", label: "Retries" }
|
|
379
|
+
] }
|
|
380
|
+
];
|
|
381
|
+
var MCP_NAV_SECTIONS = [
|
|
382
|
+
{ id: "mcp-overview", label: "Overview", children: [
|
|
383
|
+
{ id: "mcp-introduction", label: "Introduction" },
|
|
384
|
+
{ id: "mcp-installation", label: "Installation" },
|
|
385
|
+
{ id: "mcp-authentication", label: "Authentication" }
|
|
386
|
+
] },
|
|
387
|
+
{ id: "mcp-clients", label: "Client Setup", children: [
|
|
388
|
+
{ id: "mcp-claude-desktop", label: "Claude Desktop" },
|
|
389
|
+
{ id: "mcp-cursor", label: "Cursor" },
|
|
390
|
+
{ id: "mcp-cline", label: "Cline" },
|
|
391
|
+
{ id: "mcp-continue", label: "Continue" },
|
|
392
|
+
{ id: "mcp-cowork", label: "Cowork" }
|
|
393
|
+
] },
|
|
394
|
+
{ id: "mcp-tools", label: "Tools", children: [
|
|
395
|
+
{ id: "mcp-talonic-extract", label: "talonic_extract" },
|
|
396
|
+
{ id: "mcp-talonic-search", label: "talonic_search" },
|
|
397
|
+
{ id: "mcp-talonic-filter", label: "talonic_filter" },
|
|
398
|
+
{ id: "mcp-talonic-get-document", label: "talonic_get_document" },
|
|
399
|
+
{ id: "mcp-talonic-to-markdown", label: "talonic_to_markdown" },
|
|
400
|
+
{ id: "mcp-talonic-list-schemas", label: "talonic_list_schemas" },
|
|
401
|
+
{ id: "mcp-talonic-save-schema", label: "talonic_save_schema" }
|
|
402
|
+
] },
|
|
403
|
+
{ id: "mcp-resources", label: "Resources", children: [
|
|
404
|
+
{ id: "mcp-schemas-resource", label: "talonic://schemas" }
|
|
405
|
+
] },
|
|
406
|
+
{ id: "mcp-advanced", label: "Advanced", children: [
|
|
407
|
+
{ id: "mcp-drag-drop", label: "Drag & Drop in Chat" },
|
|
408
|
+
{ id: "mcp-architecture", label: "Architecture" },
|
|
409
|
+
{ id: "mcp-configuration", label: "Configuration" },
|
|
410
|
+
{ id: "mcp-troubleshooting", label: "Troubleshooting" }
|
|
411
|
+
] }
|
|
412
|
+
];
|
|
350
413
|
|
|
351
414
|
// src/content/platform/overview.ts
|
|
352
415
|
var sections = [
|
|
@@ -4441,10 +4504,11 @@ var sections17 = [
|
|
|
4441
4504
|
params: [
|
|
4442
4505
|
{ name: "extract", type: "scope", description: "Submit documents for extraction (`POST /v1/extract`, `POST /v1/documents/:id/re-extract`)." },
|
|
4443
4506
|
{ name: "read", type: "scope", description: "Read operations \u2014 list and retrieve documents, extractions, schemas, jobs, sources, and other resources." },
|
|
4444
|
-
{ name: "write", type: "scope", description: "Write operations \u2014 create, update, and delete schemas, sources, jobs, delivery bindings, and other resources." }
|
|
4507
|
+
{ name: "write", type: "scope", description: "Write operations \u2014 create, update, and delete schemas, sources, jobs, delivery bindings, and other resources." },
|
|
4508
|
+
{ name: "billing", type: "scope", description: "Billing operations \u2014 trigger credit top-ups (`POST /v1/billing/topup`). Not included by default; add explicitly when creating the key." }
|
|
4445
4509
|
]
|
|
4446
4510
|
},
|
|
4447
|
-
{ type: "paragraph", text: "If a request requires a scope your key does not carry, the API returns `403` with error code `insufficient_scope` and lists the required scopes in the response body." },
|
|
4511
|
+
{ type: "paragraph", text: "New keys default to `extract`, `read`, and `write`. The `billing` scope must be added explicitly. If a request requires a scope your key does not carry, the API returns `403` with error code `insufficient_scope` and lists the required scopes in the response body." },
|
|
4448
4512
|
{ type: "callout", text: "Keep your API key secret. Do not expose it in client-side code or version control. If a key is compromised, revoke it immediately from the dashboard." }
|
|
4449
4513
|
],
|
|
4450
4514
|
related: [
|
|
@@ -4454,7 +4518,7 @@ var sections17 = [
|
|
|
4454
4518
|
faq: [
|
|
4455
4519
|
{ question: "How do I authenticate with the Talonic API?", answer: "Include a Bearer token in the Authorization header of every request. API keys use the tlnc_ prefix." },
|
|
4456
4520
|
{ question: "Where do I get an API key?", answer: "Create and manage API keys from Settings \u2192 API Keys in the Talonic dashboard." },
|
|
4457
|
-
{ question: "What scopes are available?", answer: "
|
|
4521
|
+
{ question: "What scopes are available?", answer: "Four scopes: extract (submit documents), read (list/retrieve resources), write (create/update/delete resources), and billing (trigger credit top-ups). New keys get extract, read, and write by default; billing must be added explicitly." }
|
|
4458
4522
|
],
|
|
4459
4523
|
mentions: ["Bearer token", "API key", "Authorization header", "scopes", "extract", "read", "write"]
|
|
4460
4524
|
},
|
|
@@ -4481,9 +4545,9 @@ var sections17 = [
|
|
|
4481
4545
|
parentSlug: "overview",
|
|
4482
4546
|
title: "Quick Start",
|
|
4483
4547
|
seoTitle: "API Quick Start Guide \u2014 Talonic Docs",
|
|
4484
|
-
description: "
|
|
4548
|
+
description: "Three modes, one API. Auto-detect extraction, schema-driven extraction, and document filtering \u2014 all with per-cell confidence and cost transparency.",
|
|
4485
4549
|
content: [
|
|
4486
|
-
{ type: "paragraph", text: "
|
|
4550
|
+
{ type: "paragraph", text: "Three modes. One API. Auto-detect what's in the document. Send your own schema and get exactly that shape. Or skip the document entirely and query data you already ingested. Plus per-cell provenance, confidence scores, and cost transparency on every call." },
|
|
4487
4551
|
{ type: "heading", level: 3, id: "prerequisites", text: "Prerequisites" },
|
|
4488
4552
|
{ type: "list", items: [
|
|
4489
4553
|
"A Talonic account \u2014 sign up at [app.talonic.com](https://app.talonic.com)",
|
|
@@ -4491,15 +4555,42 @@ var sections17 = [
|
|
|
4491
4555
|
"A PDF or image file to extract (e.g. an invoice)"
|
|
4492
4556
|
] },
|
|
4493
4557
|
{ type: "code", language: "bash", title: "Set your API key", code: `export TALONIC_API_KEY="tlnc_live_..."` },
|
|
4494
|
-
{ type: "heading", level:
|
|
4495
|
-
{ type: "paragraph", text: "Send a
|
|
4496
|
-
{ type: "code", language: "bash", title: "curl \u2014
|
|
4558
|
+
{ type: "heading", level: 2, id: "mode-1-auto-detect", text: "Mode 1 \u2014 Auto-detect extract" },
|
|
4559
|
+
{ type: "paragraph", text: "Send a document with no schema. Talonic discovers every field automatically." },
|
|
4560
|
+
{ type: "code", language: "bash", title: "curl \u2014 auto-detect all fields", code: `curl -X POST https://api.talonic.com/v1/extract \\
|
|
4561
|
+
-H "Authorization: Bearer $TALONIC_API_KEY" \\
|
|
4562
|
+
-F "file=@invoice.pdf"` },
|
|
4563
|
+
{ type: "paragraph", text: "Returns every field the AI discovers \u2014 vendor, dates, amounts, line items, addresses \u2014 with per-field confidence scores. Use this when you don't know the document structure upfront." },
|
|
4564
|
+
{ type: "heading", level: 2, id: "mode-2-schema-extract", text: "Mode 2 \u2014 Schema-driven extract" },
|
|
4565
|
+
{ type: "paragraph", text: "Send a document AND the shape you want. Get exactly those fields back." },
|
|
4566
|
+
{ type: "code", language: "bash", title: "curl \u2014 extract with inline schema", code: `curl -X POST https://api.talonic.com/v1/extract \\
|
|
4497
4567
|
-H "Authorization: Bearer $TALONIC_API_KEY" \\
|
|
4498
4568
|
-F "file=@invoice.pdf" \\
|
|
4499
4569
|
-F 'schema={"vendor_name":"string","invoice_number":"string","total_amount":"number","due_date":"date"}'` },
|
|
4500
|
-
{ type: "
|
|
4501
|
-
{ type: "
|
|
4502
|
-
{ type: "
|
|
4570
|
+
{ type: "paragraph", text: "The response contains exactly the four fields you asked for \u2014 nothing more. Save the schema with `POST /v1/schemas` for reuse across future extractions." },
|
|
4571
|
+
{ type: "heading", level: 2, id: "mode-3-filter", text: "Mode 3 \u2014 Query ingested data" },
|
|
4572
|
+
{ type: "paragraph", text: "Don't send a document. Query data you already extracted \u2014 across all documents in your workspace." },
|
|
4573
|
+
{ type: "code", language: "bash", title: "curl \u2014 filter previously extracted documents", code: `curl -X POST https://api.talonic.com/v1/documents/filter \\
|
|
4574
|
+
-H "Authorization: Bearer $TALONIC_API_KEY" \\
|
|
4575
|
+
-H "Content-Type: application/json" \\
|
|
4576
|
+
-d '{
|
|
4577
|
+
"conditions": [
|
|
4578
|
+
{ "fieldId": "vendor_name", "operator": "eq", "value": "Acme GmbH" }
|
|
4579
|
+
],
|
|
4580
|
+
"limit": 50
|
|
4581
|
+
}'` },
|
|
4582
|
+
{ type: "paragraph", text: "Returns all documents matching your filter \u2014 no re-extraction, no AI cost. Ingest once, query forever." },
|
|
4583
|
+
{ type: "heading", level: 2, id: "cost-transparency", text: "Cost on every call" },
|
|
4584
|
+
{ type: "paragraph", text: "Every synchronous extraction response includes cost headers so you can track spend per call:" },
|
|
4585
|
+
{ type: "code", language: "bash", title: "Cost headers", code: `X-Talonic-Cost-Credits: 12
|
|
4586
|
+
X-Talonic-Cost-EUR: 0.012
|
|
4587
|
+
X-Talonic-Balance-Credits: 64918
|
|
4588
|
+
X-Talonic-Cells-Resolved-Registry: 3
|
|
4589
|
+
X-Talonic-Cells-Resolved-AI: 5` },
|
|
4590
|
+
{ type: "paragraph", text: "Fields resolved from the registry (`X-Talonic-Cells-Resolved-Registry`) cost nothing. Only AI-resolved fields consume credits." },
|
|
4591
|
+
{ type: "heading", level: 2, id: "example-response", text: "Example response" },
|
|
4592
|
+
{ type: "paragraph", text: "A synchronous extraction returns structured data with confidence scores:" },
|
|
4593
|
+
{ type: "code", language: "json", title: "Response (200 OK)", code: `{
|
|
4503
4594
|
"extraction_id": "d1a2b3c4-5678-9abc-def0-1234567890ab",
|
|
4504
4595
|
"request_id": "req_x7y8z9a0b1c2d3e4",
|
|
4505
4596
|
"status": "complete",
|
|
@@ -4507,7 +4598,6 @@ var sections17 = [
|
|
|
4507
4598
|
"id": "f0e1d2c3-b4a5-9687-8765-432109876543",
|
|
4508
4599
|
"filename": "invoice.pdf",
|
|
4509
4600
|
"pages": 2,
|
|
4510
|
-
"size_bytes": 184320,
|
|
4511
4601
|
"type_detected": "Invoice"
|
|
4512
4602
|
},
|
|
4513
4603
|
"data": {
|
|
@@ -4528,35 +4618,29 @@ var sections17 = [
|
|
|
4528
4618
|
"processing": {
|
|
4529
4619
|
"duration_ms": 1840,
|
|
4530
4620
|
"pages_processed": 2
|
|
4531
|
-
},
|
|
4532
|
-
"links": {
|
|
4533
|
-
"self": "/v1/extractions/d1a2b3c4-5678-9abc-def0-1234567890ab",
|
|
4534
|
-
"document": "/v1/documents/f0e1d2c3-b4a5-9687-8765-432109876543"
|
|
4535
4621
|
}
|
|
4536
4622
|
}` },
|
|
4537
|
-
{ type: "heading", level: 3, id: "step-2-verify", text: "2. Verify it worked" },
|
|
4538
|
-
{ type: "paragraph", text: "Retrieve the extraction by ID to confirm the data is persisted:" },
|
|
4539
|
-
{ type: "code", language: "bash", title: "Verify extraction", code: `curl https://api.talonic.com/v1/extractions/d1a2b3c4-5678-9abc-def0-1234567890ab \\
|
|
4540
|
-
-H "Authorization: Bearer $TALONIC_API_KEY"` },
|
|
4541
|
-
{ type: "paragraph", text: "You should see the same `data` object. The extraction is now stored and queryable across your workspace." },
|
|
4542
4623
|
{ type: "heading", level: 3, id: "next-steps", text: "Next steps" },
|
|
4543
4624
|
{ type: "list", items: [
|
|
4544
4625
|
"**Reuse schemas** \u2014 save your schema with `POST /v1/schemas`, then pass `schema_id` on future extractions.",
|
|
4545
4626
|
"**Large documents** \u2014 files >5 pages return `202 Accepted` with a `poll_url`. See [Processing Modes](extract-processing-mode).",
|
|
4546
4627
|
"**Webhooks** \u2014 receive results via `extraction.complete` events instead of polling. See [Webhook Events](webhook-events).",
|
|
4547
|
-
"**Batch mode** \u2014 process at 50% cost with `processing_mode=batch`. See [Batches](batches)."
|
|
4628
|
+
"**Batch mode** \u2014 process at 50% cost with `processing_mode=batch`. See [Batches](batches).",
|
|
4629
|
+
"**Credits** \u2014 check your balance anytime with `GET /v1/credits/balance`. See [Credits](credits-balance)."
|
|
4548
4630
|
] }
|
|
4549
4631
|
],
|
|
4550
4632
|
related: [
|
|
4551
4633
|
{ label: "POST /v1/extract", slug: "post-extract" },
|
|
4634
|
+
{ label: "Filter Documents", slug: "filter-documents" },
|
|
4552
4635
|
{ label: "Schema Formats", slug: "extract-schemas" },
|
|
4553
4636
|
{ label: "Processing Modes", slug: "extract-processing-mode" }
|
|
4554
4637
|
],
|
|
4555
4638
|
faq: [
|
|
4556
|
-
{ question: "How do I get started with the Talonic API?", answer: "
|
|
4557
|
-
{ question: "Do I need to create a schema first?", answer: "No.
|
|
4639
|
+
{ question: "How do I get started with the Talonic API?", answer: "Three modes: (1) send a file with no schema for auto-detect, (2) send a file with a schema for exact extraction, (3) POST /v1/documents/filter to query already-ingested data." },
|
|
4640
|
+
{ question: "Do I need to create a schema first?", answer: "No. Mode 1 auto-detects all fields. Mode 2 accepts an inline schema. Save it with POST /v1/schemas later for reuse." },
|
|
4641
|
+
{ question: "Can I query previously extracted data without re-extracting?", answer: "Yes. POST /v1/documents/filter lets you search across all previously extracted documents by field values. No AI cost \u2014 ingest once, query forever." }
|
|
4558
4642
|
],
|
|
4559
|
-
mentions: ["curl", "quick start", "sync mode", "
|
|
4643
|
+
mentions: ["curl", "quick start", "sync mode", "three modes", "auto-detect", "filter", "query", "cost headers"]
|
|
4560
4644
|
},
|
|
4561
4645
|
{
|
|
4562
4646
|
slug: "pagination",
|
|
@@ -4851,9 +4935,34 @@ var sections18 = [
|
|
|
4851
4935
|
{ name: "400", type: "invalid_options", description: "The options field is not valid JSON." },
|
|
4852
4936
|
{ name: "401", type: "unauthorized", description: "Missing or invalid API key." },
|
|
4853
4937
|
{ name: "422", type: "extraction_failed", description: "Extraction completed but produced no usable output. Check the document quality or schema definition." },
|
|
4854
|
-
{ name: "429", type: "rate_limited", description: "Too many requests.
|
|
4938
|
+
{ name: "429", type: "rate_limited", description: "Too many requests. Check X-RateLimit-Reset for when the window resets." }
|
|
4855
4939
|
]
|
|
4856
|
-
}
|
|
4940
|
+
},
|
|
4941
|
+
{ type: "heading", level: 2, id: "post-extract-cost-headers", text: "Cost Headers" },
|
|
4942
|
+
{ type: "paragraph", text: "Synchronous 200 responses include cost transparency headers so you can track spend per call without a separate API round-trip:" },
|
|
4943
|
+
{
|
|
4944
|
+
type: "param-table",
|
|
4945
|
+
title: "Cost response headers",
|
|
4946
|
+
params: [
|
|
4947
|
+
{ name: "X-Talonic-Cost-Credits", type: "integer", description: "Credits consumed by this extraction." },
|
|
4948
|
+
{ name: "X-Talonic-Cost-EUR", type: "number", description: "EUR cost of this extraction." },
|
|
4949
|
+
{ name: "X-Talonic-Balance-Credits", type: "integer", description: "Remaining credit balance after this call." },
|
|
4950
|
+
{ name: "X-Talonic-Cells-Resolved-Registry", type: "integer", description: "Fields resolved from the registry (no AI cost)." },
|
|
4951
|
+
{ name: "X-Talonic-Cells-Resolved-AI", type: "integer", description: "Fields resolved by the AI model." }
|
|
4952
|
+
]
|
|
4953
|
+
},
|
|
4954
|
+
{
|
|
4955
|
+
type: "code",
|
|
4956
|
+
language: "bash",
|
|
4957
|
+
title: "Cost headers on a sync response",
|
|
4958
|
+
code: `HTTP/1.1 200 OK
|
|
4959
|
+
X-Talonic-Cost-Credits: 12
|
|
4960
|
+
X-Talonic-Cost-EUR: 0.012
|
|
4961
|
+
X-Talonic-Balance-Credits: 64918
|
|
4962
|
+
X-Talonic-Cells-Resolved-Registry: 3
|
|
4963
|
+
X-Talonic-Cells-Resolved-AI: 5`
|
|
4964
|
+
},
|
|
4965
|
+
{ type: "callout", text: "Cost headers are only present on synchronous (200) responses. For async (202) extractions, check the credits balance endpoint or listen for the `extraction.complete` webhook which includes cost data." }
|
|
4857
4966
|
],
|
|
4858
4967
|
related: [
|
|
4859
4968
|
{ label: "Schema Formats", slug: "extract-schemas" },
|
|
@@ -17445,6 +17554,979 @@ X-RateLimit-Reset: 2026-04-26T00:00:00.000Z`
|
|
|
17445
17554
|
}
|
|
17446
17555
|
];
|
|
17447
17556
|
|
|
17557
|
+
// src/content/sdk/sections.json
|
|
17558
|
+
var sections_default = [
|
|
17559
|
+
{
|
|
17560
|
+
slug: "sdk-introduction",
|
|
17561
|
+
parentSlug: "sdk-overview",
|
|
17562
|
+
title: "Introduction",
|
|
17563
|
+
seoTitle: "Node SDK Introduction \u2014 Talonic Docs",
|
|
17564
|
+
description: "Official Talonic SDK for Node.js and TypeScript. Extract structured, schema-validated data from any document with a single function call.",
|
|
17565
|
+
content: [
|
|
17566
|
+
{ type: "paragraph", text: "The `@talonic/node` SDK is the official Node.js and TypeScript client for the Talonic API. Extract structured, schema-validated data from any document with a single function call." },
|
|
17567
|
+
{ type: "paragraph", text: "Zero runtime dependencies. Requires Node.js 18 or newer." },
|
|
17568
|
+
{ type: "callout", text: "Looking for the AI agent path? [`@talonic/mcp`](https://github.com/talonicdev/talonic-mcp) wraps this SDK as a Model Context Protocol server. Install it into Claude Desktop, Cursor, Cline, Continue, or Cowork and any MCP-aware agent can extract documents directly." }
|
|
17569
|
+
],
|
|
17570
|
+
related: [
|
|
17571
|
+
{ label: "Installation", slug: "sdk-installation" },
|
|
17572
|
+
{ label: "Quick Start", slug: "sdk-quickstart" },
|
|
17573
|
+
{ label: "MCP Server", slug: "mcp-introduction" }
|
|
17574
|
+
],
|
|
17575
|
+
faq: [
|
|
17576
|
+
{ question: "What is the Talonic Node SDK?", answer: "The official Node.js and TypeScript client for extracting structured, schema-validated data from documents via the Talonic API." },
|
|
17577
|
+
{ question: "What Node.js version is required?", answer: "Node.js 18 or newer. The SDK has zero runtime dependencies." }
|
|
17578
|
+
],
|
|
17579
|
+
mentions: ["Node.js", "TypeScript", "SDK", "npm", "document extraction"]
|
|
17580
|
+
},
|
|
17581
|
+
{
|
|
17582
|
+
slug: "sdk-installation",
|
|
17583
|
+
parentSlug: "sdk-overview",
|
|
17584
|
+
title: "Installation",
|
|
17585
|
+
seoTitle: "Install Talonic Node SDK \u2014 Talonic Docs",
|
|
17586
|
+
description: "Install the @talonic/node package via npm. Zero runtime dependencies, requires Node.js 18+.",
|
|
17587
|
+
content: [
|
|
17588
|
+
{ type: "code", language: "bash", title: "Install via npm", code: "npm install @talonic/node" },
|
|
17589
|
+
{ type: "paragraph", text: "Requires Node.js 18 or newer. Zero runtime dependencies." }
|
|
17590
|
+
],
|
|
17591
|
+
related: [
|
|
17592
|
+
{ label: "Authentication", slug: "sdk-authentication" },
|
|
17593
|
+
{ label: "Quick Start", slug: "sdk-quickstart" }
|
|
17594
|
+
],
|
|
17595
|
+
faq: [
|
|
17596
|
+
{ question: "How do I install the Talonic Node SDK?", answer: "Run npm install @talonic/node. Requires Node.js 18 or newer. Zero runtime dependencies." }
|
|
17597
|
+
],
|
|
17598
|
+
mentions: ["npm", "Node.js"]
|
|
17599
|
+
},
|
|
17600
|
+
{
|
|
17601
|
+
slug: "sdk-authentication",
|
|
17602
|
+
parentSlug: "sdk-overview",
|
|
17603
|
+
title: "Authentication",
|
|
17604
|
+
seoTitle: "SDK Authentication \u2014 Talonic Docs",
|
|
17605
|
+
description: "Get a Talonic API key and configure it for the Node SDK. Each workspace is isolated with private documents and schemas.",
|
|
17606
|
+
content: [
|
|
17607
|
+
{ type: "paragraph", text: "Every user runs against their own Talonic workspace, so each user needs their own key. Workspaces are isolated; your documents and schemas are private to you." },
|
|
17608
|
+
{ type: "list", ordered: true, items: [
|
|
17609
|
+
"Sign up at [https://app.talonic.com](https://app.talonic.com). Free tier: 50 extractions per day, no credit card.",
|
|
17610
|
+
"Settings → API Keys → Create New Key.",
|
|
17611
|
+
"Copy the `tlnc_` value.",
|
|
17612
|
+
"Set it as the `TALONIC_API_KEY` environment variable, or pass it directly to the client constructor."
|
|
17613
|
+
] },
|
|
17614
|
+
{ type: "callout", text: "Keep your API key secret. Do not expose it in client-side code or version control." }
|
|
17615
|
+
],
|
|
17616
|
+
related: [
|
|
17617
|
+
{ label: "Configuration", slug: "sdk-configuration" },
|
|
17618
|
+
{ label: "API Authentication", slug: "authentication" }
|
|
17619
|
+
],
|
|
17620
|
+
faq: [
|
|
17621
|
+
{ question: "Where do I get a Talonic API key?", answer: "Sign up at app.talonic.com, go to Settings \u2192 API Keys \u2192 Create New Key. Free tier includes 50 extractions per day." }
|
|
17622
|
+
],
|
|
17623
|
+
mentions: ["API key", "authentication", "workspace"]
|
|
17624
|
+
},
|
|
17625
|
+
{
|
|
17626
|
+
slug: "sdk-quickstart",
|
|
17627
|
+
parentSlug: "sdk-overview",
|
|
17628
|
+
title: "Quick Start",
|
|
17629
|
+
seoTitle: "Node SDK Quick Start \u2014 Talonic Docs",
|
|
17630
|
+
description: "Extract structured data from a document in five lines of TypeScript using the Talonic Node SDK.",
|
|
17631
|
+
content: [
|
|
17632
|
+
{ type: "code", language: "typescript", title: "Extract an invoice", code: 'import { Talonic } from "@talonic/node"\n\nconst talonic = new Talonic({ apiKey: process.env.TALONIC_API_KEY! })\n\nconst result = await talonic.extract({\n file_path: "./invoice.pdf",\n schema: {\n vendor_name: "string",\n invoice_number: "string",\n total_amount: "number",\n due_date: "date",\n },\n})\n\nconsole.log(result.data)\n// { vendor_name: "Acme Corp", invoice_number: "INV-2024-0847", total_amount: 14250, due_date: "2024-03-15" }' }
|
|
17633
|
+
],
|
|
17634
|
+
related: [
|
|
17635
|
+
{ label: "Extract", slug: "sdk-extract" },
|
|
17636
|
+
{ label: "Configuration", slug: "sdk-configuration" },
|
|
17637
|
+
{ label: "Schemas", slug: "sdk-schemas" }
|
|
17638
|
+
],
|
|
17639
|
+
faq: [
|
|
17640
|
+
{ question: "How do I extract data from a document with the SDK?", answer: "Call talonic.extract() with a file_path and a schema defining the fields you want. Returns structured JSON with confidence scores." }
|
|
17641
|
+
],
|
|
17642
|
+
mentions: ["extract", "schema", "TypeScript", "quickstart"]
|
|
17643
|
+
},
|
|
17644
|
+
{
|
|
17645
|
+
slug: "sdk-configuration",
|
|
17646
|
+
parentSlug: "sdk-client",
|
|
17647
|
+
title: "Configuration",
|
|
17648
|
+
seoTitle: "SDK Configuration \u2014 Talonic Docs",
|
|
17649
|
+
description: "Configure the Talonic client with API key, base URL, timeout, max retries, and custom fetch function.",
|
|
17650
|
+
content: [
|
|
17651
|
+
{ type: "code", language: "typescript", title: "Client configuration", code: 'const talonic = new Talonic({\n apiKey: process.env.TALONIC_API_KEY!,\n baseUrl: "https://api.talonic.com", // default\n timeout: 60_000, // ms; default 60s\n maxRetries: 3, // 429, 500, 502, 503, 504, network, timeout\n fetch: customFetch, // optional override (e.g. for testing)\n})' },
|
|
17652
|
+
{ type: "param-table", title: "Constructor options", params: [
|
|
17653
|
+
{ name: "apiKey", type: "string", required: true, description: "Your Talonic API key. Starts with `tlnc_`." },
|
|
17654
|
+
{ name: "baseUrl", type: "string", description: "API base URL. Default: `https://api.talonic.com`." },
|
|
17655
|
+
{ name: "timeout", type: "number", description: "Request timeout in milliseconds. Default: `60000`." },
|
|
17656
|
+
{ name: "maxRetries", type: "number", description: "Maximum retry attempts for transient errors. Default: `3`." },
|
|
17657
|
+
{ name: "fetch", type: "function", description: "Custom fetch implementation for testing or proxying." }
|
|
17658
|
+
] }
|
|
17659
|
+
],
|
|
17660
|
+
related: [
|
|
17661
|
+
{ label: "Retries", slug: "sdk-retries" },
|
|
17662
|
+
{ label: "Error Classes", slug: "sdk-error-classes" }
|
|
17663
|
+
],
|
|
17664
|
+
faq: [],
|
|
17665
|
+
mentions: ["configuration", "timeout", "retries", "fetch"]
|
|
17666
|
+
},
|
|
17667
|
+
{
|
|
17668
|
+
slug: "sdk-extract",
|
|
17669
|
+
parentSlug: "sdk-client",
|
|
17670
|
+
title: "Extract",
|
|
17671
|
+
seoTitle: "SDK Extract Method \u2014 Talonic Docs",
|
|
17672
|
+
description: "The top-level talonic.extract() method for single-call document extraction with schema validation.",
|
|
17673
|
+
content: [
|
|
17674
|
+
{ type: "paragraph", text: "The top-level `extract()` method is the fastest way to get structured data from a document. Provide a file and a schema, get back validated JSON." },
|
|
17675
|
+
{ type: "code", language: "typescript", title: "Basic extraction", code: 'const result = await talonic.extract({\n file_path: "./invoice.pdf",\n schema: {\n vendor_name: "string",\n invoice_number: "string",\n total_amount: "number",\n },\n})' },
|
|
17676
|
+
{ type: "paragraph", text: "You can also pass `file_url`, `schema_id` (for saved schemas), or a full JSON Schema definition." }
|
|
17677
|
+
],
|
|
17678
|
+
related: [
|
|
17679
|
+
{ label: "Quick Start", slug: "sdk-quickstart" },
|
|
17680
|
+
{ label: "Schemas", slug: "sdk-schemas" },
|
|
17681
|
+
{ label: "POST /v1/extract", slug: "post-extract" }
|
|
17682
|
+
],
|
|
17683
|
+
faq: [],
|
|
17684
|
+
mentions: ["extract", "schema", "file_path", "file_url"]
|
|
17685
|
+
},
|
|
17686
|
+
{
|
|
17687
|
+
slug: "sdk-documents",
|
|
17688
|
+
parentSlug: "sdk-resources",
|
|
17689
|
+
title: "Documents",
|
|
17690
|
+
seoTitle: "SDK Documents Resource \u2014 Talonic Docs",
|
|
17691
|
+
description: "List, get, delete, and re-extract documents using the Talonic Node SDK documents resource.",
|
|
17692
|
+
content: [
|
|
17693
|
+
{ type: "code", language: "typescript", title: "Documents API", code: "// List documents with pagination\nawait talonic.documents.list({ per_page: 50 })\n\n// Get a single document\nawait talonic.documents.get(id)\n\n// Get OCR markdown\nawait talonic.documents.getMarkdown(id)\n\n// Re-extract a document\nawait talonic.documents.reExtract(id)\n\n// Delete a document\nawait talonic.documents.delete(id)" }
|
|
17694
|
+
],
|
|
17695
|
+
related: [
|
|
17696
|
+
{ label: "Documents API", slug: "list-documents" },
|
|
17697
|
+
{ label: "Extractions", slug: "sdk-extractions" }
|
|
17698
|
+
],
|
|
17699
|
+
faq: [],
|
|
17700
|
+
mentions: ["documents", "list", "get", "delete", "markdown", "re-extract"]
|
|
17701
|
+
},
|
|
17702
|
+
{
|
|
17703
|
+
slug: "sdk-extractions",
|
|
17704
|
+
parentSlug: "sdk-resources",
|
|
17705
|
+
title: "Extractions",
|
|
17706
|
+
seoTitle: "SDK Extractions Resource \u2014 Talonic Docs",
|
|
17707
|
+
description: "Query extraction results, retrieve structured data in JSON or CSV, and submit field corrections via the Node SDK.",
|
|
17708
|
+
content: [
|
|
17709
|
+
{ type: "code", language: "typescript", title: "Extractions API", code: '// List extractions for a document\nawait talonic.extractions.list({ document_id })\n\n// Get extraction metadata\nawait talonic.extractions.get(id)\n\n// Get structured data as object\nawait talonic.extractions.getData(id)\n\n// Get structured data as CSV string\nawait talonic.extractions.getData(id, { format: "csv" })\n\n// Submit corrections\nawait talonic.extractions.patch(id, { corrections: [...] })' }
|
|
17710
|
+
],
|
|
17711
|
+
related: [
|
|
17712
|
+
{ label: "Extractions API", slug: "list-extractions" },
|
|
17713
|
+
{ label: "Documents", slug: "sdk-documents" }
|
|
17714
|
+
],
|
|
17715
|
+
faq: [],
|
|
17716
|
+
mentions: ["extractions", "corrections", "CSV", "structured data"]
|
|
17717
|
+
},
|
|
17718
|
+
{
|
|
17719
|
+
slug: "sdk-schemas",
|
|
17720
|
+
parentSlug: "sdk-resources",
|
|
17721
|
+
title: "Schemas",
|
|
17722
|
+
seoTitle: "SDK Schemas Resource \u2014 Talonic Docs",
|
|
17723
|
+
description: "Create, list, get, update, and delete reusable extraction schemas via the Talonic Node SDK.",
|
|
17724
|
+
content: [
|
|
17725
|
+
{ type: "code", language: "typescript", title: "Schemas API", code: "// List all schemas\nawait talonic.schemas.list()\n\n// Get a schema\nawait talonic.schemas.get(id)\n\n// Create a new schema\nawait talonic.schemas.create({ name, definition })\n\n// Update a schema\nawait talonic.schemas.update(id, { ... })\n\n// Delete a schema\nawait talonic.schemas.delete(id)" }
|
|
17726
|
+
],
|
|
17727
|
+
related: [
|
|
17728
|
+
{ label: "Schemas API", slug: "list-schemas" },
|
|
17729
|
+
{ label: "Extract", slug: "sdk-extract" }
|
|
17730
|
+
],
|
|
17731
|
+
faq: [],
|
|
17732
|
+
mentions: ["schemas", "create", "update", "delete"]
|
|
17733
|
+
},
|
|
17734
|
+
{
|
|
17735
|
+
slug: "sdk-jobs",
|
|
17736
|
+
parentSlug: "sdk-resources",
|
|
17737
|
+
title: "Jobs",
|
|
17738
|
+
seoTitle: "SDK Jobs Resource \u2014 Talonic Docs",
|
|
17739
|
+
description: "Create, list, get results, and cancel asynchronous batch extraction jobs via the Node SDK.",
|
|
17740
|
+
content: [
|
|
17741
|
+
{ type: "code", language: "typescript", title: "Jobs API", code: "// Create a batch job\nawait talonic.jobs.create({ schema_id, document_ids })\n\n// List all jobs\nawait talonic.jobs.list()\n\n// Get job status\nawait talonic.jobs.get(id)\n\n// Get job results\nawait talonic.jobs.getResults(id)\n\n// Cancel a running job\nawait talonic.jobs.cancel(id)" }
|
|
17742
|
+
],
|
|
17743
|
+
related: [
|
|
17744
|
+
{ label: "Jobs API", slug: "list-jobs" },
|
|
17745
|
+
{ label: "Batch Inference", slug: "batch-overview" }
|
|
17746
|
+
],
|
|
17747
|
+
faq: [],
|
|
17748
|
+
mentions: ["jobs", "batch", "asynchronous", "cancel"]
|
|
17749
|
+
},
|
|
17750
|
+
{
|
|
17751
|
+
slug: "sdk-cli-usage",
|
|
17752
|
+
parentSlug: "sdk-cli",
|
|
17753
|
+
title: "Usage",
|
|
17754
|
+
seoTitle: "Talonic CLI Usage \u2014 Talonic Docs",
|
|
17755
|
+
description: "Use the talonic CLI binary for command-line extraction, schema management, and document listing.",
|
|
17756
|
+
content: [
|
|
17757
|
+
{ type: "paragraph", text: "The package ships with a `talonic` binary for command-line usage:" },
|
|
17758
|
+
{ type: "code", language: "bash", title: "CLI examples", code: `talonic schemas list
|
|
17759
|
+
talonic documents list --per-page=20
|
|
17760
|
+
talonic extract ./invoice.pdf \\
|
|
17761
|
+
--schema='{"vendor_name":"string","total_amount":"number"}'
|
|
17762
|
+
talonic --help` }
|
|
17763
|
+
],
|
|
17764
|
+
related: [
|
|
17765
|
+
{ label: "Extract", slug: "sdk-extract" },
|
|
17766
|
+
{ label: "Schemas", slug: "sdk-schemas" }
|
|
17767
|
+
],
|
|
17768
|
+
faq: [
|
|
17769
|
+
{ question: "Does the Talonic SDK include a CLI?", answer: "Yes. The @talonic/node package ships a talonic binary for command-line extraction, schema management, and document operations." }
|
|
17770
|
+
],
|
|
17771
|
+
mentions: ["CLI", "command line", "talonic binary"]
|
|
17772
|
+
},
|
|
17773
|
+
{
|
|
17774
|
+
slug: "sdk-error-classes",
|
|
17775
|
+
parentSlug: "sdk-errors",
|
|
17776
|
+
title: "Error Classes",
|
|
17777
|
+
seoTitle: "SDK Error Classes \u2014 Talonic Docs",
|
|
17778
|
+
description: "Typed error hierarchy for the Talonic Node SDK: TalonicError base class with subclasses for auth, validation, rate limit, server, network, and timeout errors.",
|
|
17779
|
+
content: [
|
|
17780
|
+
{ type: "paragraph", text: "Every failure is a `TalonicError` subclass with `code`, `status`, `requestId`, and `message` properties:" },
|
|
17781
|
+
{ type: "param-table", title: "Error classes", params: [
|
|
17782
|
+
{ name: "TalonicAuthError", type: "401, 403", description: "Authentication or authorization failure." },
|
|
17783
|
+
{ name: "TalonicNotFoundError", type: "404", description: "Resource not found." },
|
|
17784
|
+
{ name: "TalonicValidationError", type: "400, 409, 413, 422", description: "Request validation failure." },
|
|
17785
|
+
{ name: "TalonicRateLimitError", type: "429", description: "Rate limit exceeded (after retries exhausted). Includes `rateLimit.resetAt`." },
|
|
17786
|
+
{ name: "TalonicServerError", type: "5xx", description: "Server error (after retries exhausted)." },
|
|
17787
|
+
{ name: "TalonicNetworkError", type: "\u2014", description: "DNS or TCP connection failure." },
|
|
17788
|
+
{ name: "TalonicTimeoutError", type: "\u2014", description: "Request exceeded configured timeout." }
|
|
17789
|
+
] },
|
|
17790
|
+
{ type: "code", language: "typescript", title: "Error handling", code: 'import {\n TalonicError,\n TalonicRateLimitError,\n} from "@talonic/node"\n\ntry {\n await talonic.extract({ ... })\n} catch (err) {\n if (err instanceof TalonicRateLimitError) {\n console.log(`Reset at ${err.rateLimit.resetAt}`)\n } else if (err instanceof TalonicError) {\n console.error(`${err.code} (status ${err.status}, request ${err.requestId}): ${err.message}`)\n }\n}' }
|
|
17791
|
+
],
|
|
17792
|
+
related: [
|
|
17793
|
+
{ label: "Retries", slug: "sdk-retries" },
|
|
17794
|
+
{ label: "Error Codes", slug: "error-codes" }
|
|
17795
|
+
],
|
|
17796
|
+
faq: [
|
|
17797
|
+
{ question: "What error types does the Talonic SDK throw?", answer: "TalonicAuthError (401/403), TalonicNotFoundError (404), TalonicValidationError (400/409/413/422), TalonicRateLimitError (429), TalonicServerError (5xx), TalonicNetworkError, and TalonicTimeoutError." }
|
|
17798
|
+
],
|
|
17799
|
+
mentions: ["TalonicError", "error handling", "typed errors"]
|
|
17800
|
+
},
|
|
17801
|
+
{
|
|
17802
|
+
slug: "sdk-retries",
|
|
17803
|
+
parentSlug: "sdk-errors",
|
|
17804
|
+
title: "Retries",
|
|
17805
|
+
seoTitle: "SDK Retry Behavior \u2014 Talonic Docs",
|
|
17806
|
+
description: "Automatic retry behavior for the Talonic Node SDK: exponential backoff with jitter on transient errors and rate limits.",
|
|
17807
|
+
content: [
|
|
17808
|
+
{ type: "paragraph", text: "The SDK retries automatically on `429` (respecting `X-RateLimit-Reset`), `500`, `502`, `503`, `504`, network errors, and timeouts. Backoff is exponential with jitter, capped at 16 seconds." },
|
|
17809
|
+
{ type: "paragraph", text: "The API may set `retryable: false` on a specific error; the SDK respects that and does not retry." },
|
|
17810
|
+
{ type: "paragraph", text: "Configure the maximum number of retries via the `maxRetries` constructor option (default: `3`)." }
|
|
17811
|
+
],
|
|
17812
|
+
related: [
|
|
17813
|
+
{ label: "Configuration", slug: "sdk-configuration" },
|
|
17814
|
+
{ label: "Error Classes", slug: "sdk-error-classes" },
|
|
17815
|
+
{ label: "Rate Limits", slug: "rate-limits" }
|
|
17816
|
+
],
|
|
17817
|
+
faq: [
|
|
17818
|
+
{ question: "Does the SDK retry failed requests?", answer: "Yes. Automatic retries on 429, 500, 502, 503, 504, network errors, and timeouts with exponential backoff capped at 16s. Configure via maxRetries (default: 3)." }
|
|
17819
|
+
],
|
|
17820
|
+
mentions: ["retries", "exponential backoff", "rate limit", "429"]
|
|
17821
|
+
}
|
|
17822
|
+
];
|
|
17823
|
+
|
|
17824
|
+
// src/content/sdk/index.ts
|
|
17825
|
+
var sections45 = sections_default;
|
|
17826
|
+
|
|
17827
|
+
// src/content/mcp/sections.json
|
|
17828
|
+
var sections_default2 = [
|
|
17829
|
+
{
|
|
17830
|
+
slug: "mcp-introduction",
|
|
17831
|
+
parentSlug: "mcp-overview",
|
|
17832
|
+
title: "Introduction",
|
|
17833
|
+
seoTitle: "MCP Server Introduction \u2014 Talonic Docs",
|
|
17834
|
+
description: "Official Talonic MCP server for AI agents. Seven tools and one resource for structured document extraction via the Model Context Protocol.",
|
|
17835
|
+
content: [
|
|
17836
|
+
{ type: "paragraph", text: "The `@talonic/mcp` package is the official Talonic MCP server. It gives AI agents seven tools for extracting structured, schema-validated data from any document via the [Model Context Protocol](https://modelcontextprotocol.io)." },
|
|
17837
|
+
{ type: "paragraph", text: "When an agent needs to pull structured data out of a PDF, scan, image, or messy document, the usual approach is raw OCR plus an LLM call. Results are unreliable; tables get mangled, dates get misread, totals drift." },
|
|
17838
|
+
{ type: "paragraph", text: "With this MCP server installed, the agent has a `talonic_extract` tool that returns schema-validated JSON with per-field confidence scores, a detected document type, and stable IDs for follow-up calls." },
|
|
17839
|
+
{ type: "callout", text: "Listed on the [official MCP Registry](https://registry.modelcontextprotocol.io/) as `io.github.talonicdev/talonic-mcp`." }
|
|
17840
|
+
],
|
|
17841
|
+
related: [
|
|
17842
|
+
{ label: "Installation", slug: "mcp-installation" },
|
|
17843
|
+
{ label: "Tools", slug: "mcp-talonic-extract" },
|
|
17844
|
+
{ label: "Node SDK", slug: "sdk-introduction" }
|
|
17845
|
+
],
|
|
17846
|
+
faq: [
|
|
17847
|
+
{ question: "What is the Talonic MCP server?", answer: "An official Model Context Protocol server that gives AI agents seven tools for document extraction, search, filtering, and schema management via the Talonic API." }
|
|
17848
|
+
],
|
|
17849
|
+
mentions: ["MCP", "Model Context Protocol", "AI agents", "document extraction"]
|
|
17850
|
+
},
|
|
17851
|
+
{
|
|
17852
|
+
slug: "mcp-installation",
|
|
17853
|
+
parentSlug: "mcp-overview",
|
|
17854
|
+
title: "Installation",
|
|
17855
|
+
seoTitle: "Install Talonic MCP Server \u2014 Talonic Docs",
|
|
17856
|
+
description: "Two ways to connect: hosted MCP at mcp.talonic.com (zero install) or local via npx. Full config examples for both.",
|
|
17857
|
+
content: [
|
|
17858
|
+
{ type: "paragraph", text: "Two ways to connect. The hosted server at `mcp.talonic.com` requires zero install \u2014 paste one URL into any MCP client. Or run locally via `npx` if you prefer." },
|
|
17859
|
+
{ type: "heading", level: 3, text: "Hosted (recommended)" },
|
|
17860
|
+
{ type: "paragraph", text: "No install, no Node.js required. Works with every MCP client that supports remote servers. The hosted server runs the latest published version and is maintained by Talonic." },
|
|
17861
|
+
{ type: "code", language: "json", title: "Hosted config", code: '{\n "mcpServers": {\n "talonic": {\n "url": "https://mcp.talonic.com/mcp",\n "headers": {\n "Authorization": "Bearer tlnc_your_key_here"\n }\n }\n }\n}' },
|
|
17862
|
+
{ type: "paragraph", text: "Your API key is sent via the `Authorization: Bearer` header on every request. The server creates an authenticated session per client connection." },
|
|
17863
|
+
{ type: "heading", level: 3, text: "Local (npx)" },
|
|
17864
|
+
{ type: "paragraph", text: "Runs on your machine. Requires Node.js 18+. Use this if your MCP client does not support remote servers, or if you need to point at a custom API base URL:" },
|
|
17865
|
+
{ type: "code", language: "json", title: "Local config", code: '{\n "mcpServers": {\n "talonic": {\n "command": "npx",\n "args": ["-y", "@talonic/mcp@latest"],\n "env": {\n "TALONIC_API_KEY": "tlnc_your_key_here"\n }\n }\n }\n}' },
|
|
17866
|
+
{ type: "paragraph", text: "The `-y` flag skips the npm install prompt. Pinning to `@latest` means new versions are picked up on the next client restart." },
|
|
17867
|
+
{ type: "heading", level: 3, text: "Hosted vs Local" },
|
|
17868
|
+
{ type: "paragraph", text: "**Use hosted when:** you want zero setup, your client supports remote MCP servers (Claude Desktop, Cursor, Cline, Continue, Cowork), you don't want to install Node.js, or you're deploying to a team and want everyone on the same server version." },
|
|
17869
|
+
{ type: "paragraph", text: "**Use local when:** your MCP client only supports stdio transport, you need to override `TALONIC_BASE_URL` for staging/testing, or you need an air-gapped environment." }
|
|
17870
|
+
],
|
|
17871
|
+
related: [
|
|
17872
|
+
{ label: "Claude Desktop", slug: "mcp-claude-desktop" },
|
|
17873
|
+
{ label: "Cursor", slug: "mcp-cursor" },
|
|
17874
|
+
{ label: "Authentication", slug: "mcp-authentication" }
|
|
17875
|
+
],
|
|
17876
|
+
faq: [
|
|
17877
|
+
{ question: "How do I install the Talonic MCP server?", answer: "Use the hosted server at mcp.talonic.com/mcp \u2014 set the URL and your API key in any MCP client config. No install needed. Alternatively, run locally via npx @talonic/mcp." },
|
|
17878
|
+
{ question: "What is the difference between hosted and local MCP?", answer: "Hosted runs at mcp.talonic.com with zero install \u2014 just a URL and API key. Local runs on your machine via npx, useful when your client only supports stdio or you need a custom base URL." }
|
|
17879
|
+
],
|
|
17880
|
+
mentions: ["npx", "npm", "MCP client", "install", "hosted", "mcp.talonic.com"]
|
|
17881
|
+
},
|
|
17882
|
+
{
|
|
17883
|
+
slug: "mcp-authentication",
|
|
17884
|
+
parentSlug: "mcp-overview",
|
|
17885
|
+
title: "Authentication",
|
|
17886
|
+
seoTitle: "MCP Authentication \u2014 Talonic Docs",
|
|
17887
|
+
description: "Get a Talonic API key for the MCP server. Hosted uses Authorization header; local uses env var.",
|
|
17888
|
+
content: [
|
|
17889
|
+
{ type: "paragraph", text: "Each user runs against their own isolated Talonic workspace. Your documents and schemas are private to you." },
|
|
17890
|
+
{ type: "list", ordered: true, items: [
|
|
17891
|
+
"Sign up at [https://app.talonic.com](https://app.talonic.com). Free tier: 50 extractions per day, no credit card.",
|
|
17892
|
+
"Settings \u2192 API Keys \u2192 Create New Key.",
|
|
17893
|
+
"Copy the `tlnc_` value into your MCP client config."
|
|
17894
|
+
] },
|
|
17895
|
+
{ type: "heading", level: 3, text: "Auth for hosted server" },
|
|
17896
|
+
{ type: "paragraph", text: "The hosted server at `mcp.talonic.com` accepts the API key in two ways:" },
|
|
17897
|
+
{ type: "list", ordered: false, items: [
|
|
17898
|
+
"`Authorization: Bearer tlnc_...` header (recommended, used in the `headers` config block)",
|
|
17899
|
+
"`?apiKey=tlnc_...` query parameter (convenience for clients that don't support custom headers)"
|
|
17900
|
+
] },
|
|
17901
|
+
{ type: "heading", level: 3, text: "Auth for local server" },
|
|
17902
|
+
{ type: "paragraph", text: "Set `TALONIC_API_KEY` in the `env` block of your MCP client config. The server reads it at startup." }
|
|
17903
|
+
],
|
|
17904
|
+
related: [
|
|
17905
|
+
{ label: "Installation", slug: "mcp-installation" },
|
|
17906
|
+
{ label: "API Authentication", slug: "authentication" }
|
|
17907
|
+
],
|
|
17908
|
+
faq: [
|
|
17909
|
+
{ question: "How do I authenticate with the hosted MCP server?", answer: "Pass your API key via the Authorization: Bearer header in the MCP client config headers block, or as a ?apiKey= query parameter on the URL." }
|
|
17910
|
+
],
|
|
17911
|
+
mentions: ["API key", "workspace", "authentication", "Authorization", "Bearer"]
|
|
17912
|
+
},
|
|
17913
|
+
{
|
|
17914
|
+
slug: "mcp-claude-desktop",
|
|
17915
|
+
parentSlug: "mcp-clients",
|
|
17916
|
+
title: "Claude Desktop",
|
|
17917
|
+
seoTitle: "MCP Setup for Claude Desktop \u2014 Talonic Docs",
|
|
17918
|
+
description: "Step-by-step setup for the Talonic MCP server in Claude Desktop on macOS and Windows. Hosted and local configs.",
|
|
17919
|
+
content: [
|
|
17920
|
+
{ type: "paragraph", text: "Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\\Claude\\claude_desktop_config.json` (Windows)." },
|
|
17921
|
+
{ type: "heading", level: 3, text: "Hosted (recommended)" },
|
|
17922
|
+
{ type: "code", language: "json", title: "claude_desktop_config.json", code: '{\n "mcpServers": {\n "talonic": {\n "url": "https://mcp.talonic.com/mcp",\n "headers": {\n "Authorization": "Bearer tlnc_your_key_here"\n }\n }\n }\n}' },
|
|
17923
|
+
{ type: "heading", level: 3, text: "Local (npx)" },
|
|
17924
|
+
{ type: "code", language: "json", title: "claude_desktop_config.json", code: '{\n "mcpServers": {\n "talonic": {\n "command": "npx",\n "args": ["-y", "@talonic/mcp@latest"],\n "env": {\n "TALONIC_API_KEY": "tlnc_your_key_here"\n }\n }\n }\n}' },
|
|
17925
|
+
{ type: "paragraph", text: "Fully restart Claude Desktop (Cmd+Q on macOS, not just close the window). Talonic appears in the connected servers list with all seven tools." }
|
|
17926
|
+
],
|
|
17927
|
+
related: [
|
|
17928
|
+
{ label: "Cursor", slug: "mcp-cursor" },
|
|
17929
|
+
{ label: "Tool Reference", slug: "mcp-talonic-extract" }
|
|
17930
|
+
],
|
|
17931
|
+
faq: [
|
|
17932
|
+
{ question: "How do I add Talonic to Claude Desktop?", answer: "Edit claude_desktop_config.json, add the Talonic MCP server config (hosted URL or local npx) with your API key, and fully restart Claude Desktop (Cmd+Q on macOS)." }
|
|
17933
|
+
],
|
|
17934
|
+
mentions: ["Claude Desktop", "macOS", "Windows"]
|
|
17935
|
+
},
|
|
17936
|
+
{
|
|
17937
|
+
slug: "mcp-cursor",
|
|
17938
|
+
parentSlug: "mcp-clients",
|
|
17939
|
+
title: "Cursor",
|
|
17940
|
+
seoTitle: "MCP Setup for Cursor \u2014 Talonic Docs",
|
|
17941
|
+
description: "Configure the Talonic MCP server in Cursor IDE. Hosted and local configs.",
|
|
17942
|
+
content: [
|
|
17943
|
+
{ type: "paragraph", text: "Edit `~/.cursor/mcp.json` (or open Cursor settings \u2192 MCP \u2192 edit config):" },
|
|
17944
|
+
{ type: "heading", level: 3, text: "Hosted (recommended)" },
|
|
17945
|
+
{ type: "code", language: "json", title: "~/.cursor/mcp.json", code: '{\n "mcpServers": {\n "talonic": {\n "url": "https://mcp.talonic.com/mcp",\n "headers": {\n "Authorization": "Bearer tlnc_your_key_here"\n }\n }\n }\n}' },
|
|
17946
|
+
{ type: "heading", level: 3, text: "Local (npx)" },
|
|
17947
|
+
{ type: "code", language: "json", title: "~/.cursor/mcp.json", code: '{\n "mcpServers": {\n "talonic": {\n "command": "npx",\n "args": ["-y", "@talonic/mcp@latest"],\n "env": {\n "TALONIC_API_KEY": "tlnc_your_key_here"\n }\n }\n }\n}' }
|
|
17948
|
+
],
|
|
17949
|
+
related: [
|
|
17950
|
+
{ label: "Claude Desktop", slug: "mcp-claude-desktop" },
|
|
17951
|
+
{ label: "Cline", slug: "mcp-cline" }
|
|
17952
|
+
],
|
|
17953
|
+
faq: [
|
|
17954
|
+
{ question: "How do I add Talonic MCP to Cursor?", answer: "Edit ~/.cursor/mcp.json and add the Talonic MCP server config with your API key. Hosted or local." }
|
|
17955
|
+
],
|
|
17956
|
+
mentions: ["Cursor", "IDE"]
|
|
17957
|
+
},
|
|
17958
|
+
{
|
|
17959
|
+
slug: "mcp-cline",
|
|
17960
|
+
parentSlug: "mcp-clients",
|
|
17961
|
+
title: "Cline",
|
|
17962
|
+
seoTitle: "MCP Setup for Cline \u2014 Talonic Docs",
|
|
17963
|
+
description: "Configure the Talonic MCP server in the Cline VS Code extension. Hosted and local configs.",
|
|
17964
|
+
content: [
|
|
17965
|
+
{ type: "paragraph", text: "Open the Cline panel \u2192 settings (gear icon) \u2192 MCP Servers \u2192 Edit." },
|
|
17966
|
+
{ type: "heading", level: 3, text: "Hosted (recommended)" },
|
|
17967
|
+
{ type: "code", language: "json", code: '{\n "mcpServers": {\n "talonic": {\n "url": "https://mcp.talonic.com/mcp",\n "headers": {\n "Authorization": "Bearer tlnc_your_key_here"\n }\n }\n }\n}' },
|
|
17968
|
+
{ type: "heading", level: 3, text: "Local (npx)" },
|
|
17969
|
+
{ type: "code", language: "json", code: '{\n "mcpServers": {\n "talonic": {\n "command": "npx",\n "args": ["-y", "@talonic/mcp@latest"],\n "env": {\n "TALONIC_API_KEY": "tlnc_your_key_here"\n }\n }\n }\n}' },
|
|
17970
|
+
{ type: "paragraph", text: "Save and restart the panel." }
|
|
17971
|
+
],
|
|
17972
|
+
related: [
|
|
17973
|
+
{ label: "Continue", slug: "mcp-continue" },
|
|
17974
|
+
{ label: "Cursor", slug: "mcp-cursor" }
|
|
17975
|
+
],
|
|
17976
|
+
faq: [
|
|
17977
|
+
{ question: "How do I add Talonic MCP to Cline?", answer: "Open the Cline panel settings, go to MCP Servers, click Edit, and add the Talonic config entry." }
|
|
17978
|
+
],
|
|
17979
|
+
mentions: ["Cline", "VS Code"]
|
|
17980
|
+
},
|
|
17981
|
+
{
|
|
17982
|
+
slug: "mcp-continue",
|
|
17983
|
+
parentSlug: "mcp-clients",
|
|
17984
|
+
title: "Continue",
|
|
17985
|
+
seoTitle: "MCP Setup for Continue \u2014 Talonic Docs",
|
|
17986
|
+
description: "Configure the Talonic MCP server in Continue for VS Code and JetBrains. Hosted and local configs.",
|
|
17987
|
+
content: [
|
|
17988
|
+
{ type: "paragraph", text: "Edit `~/.continue/config.json`. Add to the `mcpServers` array:" },
|
|
17989
|
+
{ type: "heading", level: 3, text: "Hosted (recommended)" },
|
|
17990
|
+
{ type: "code", language: "json", title: "~/.continue/config.json", code: '{\n "name": "talonic",\n "url": "https://mcp.talonic.com/mcp",\n "headers": {\n "Authorization": "Bearer tlnc_your_key_here"\n }\n}' },
|
|
17991
|
+
{ type: "heading", level: 3, text: "Local (npx)" },
|
|
17992
|
+
{ type: "code", language: "json", title: "~/.continue/config.json", code: '{\n "name": "talonic",\n "command": "npx",\n "args": ["-y", "@talonic/mcp@latest"],\n "env": {\n "TALONIC_API_KEY": "tlnc_your_key_here"\n }\n}' }
|
|
17993
|
+
],
|
|
17994
|
+
related: [
|
|
17995
|
+
{ label: "Cowork", slug: "mcp-cowork" },
|
|
17996
|
+
{ label: "Cline", slug: "mcp-cline" }
|
|
17997
|
+
],
|
|
17998
|
+
faq: [
|
|
17999
|
+
{ question: "How do I add Talonic MCP to Continue?", answer: "Edit ~/.continue/config.json and add a Talonic entry to the mcpServers array with your API key." }
|
|
18000
|
+
],
|
|
18001
|
+
mentions: ["Continue", "VS Code", "JetBrains"]
|
|
18002
|
+
},
|
|
18003
|
+
{
|
|
18004
|
+
slug: "mcp-cowork",
|
|
18005
|
+
parentSlug: "mcp-clients",
|
|
18006
|
+
title: "Cowork",
|
|
18007
|
+
seoTitle: "MCP Setup for Cowork \u2014 Talonic Docs",
|
|
18008
|
+
description: "Configure the Talonic MCP server in Cowork. Hosted and local configs.",
|
|
18009
|
+
content: [
|
|
18010
|
+
{ type: "paragraph", text: "Open Cowork settings \u2192 MCP Servers \u2192 Add." },
|
|
18011
|
+
{ type: "heading", level: 3, text: "Hosted (recommended)" },
|
|
18012
|
+
{ type: "code", language: "json", code: '{\n "mcpServers": {\n "talonic": {\n "url": "https://mcp.talonic.com/mcp",\n "headers": {\n "Authorization": "Bearer tlnc_your_key_here"\n }\n }\n }\n}' },
|
|
18013
|
+
{ type: "heading", level: 3, text: "Local (npx)" },
|
|
18014
|
+
{ type: "code", language: "json", code: '{\n "mcpServers": {\n "talonic": {\n "command": "npx",\n "args": ["-y", "@talonic/mcp@latest"],\n "env": {\n "TALONIC_API_KEY": "tlnc_your_key_here"\n }\n }\n }\n}' }
|
|
18015
|
+
],
|
|
18016
|
+
related: [
|
|
18017
|
+
{ label: "Claude Desktop", slug: "mcp-claude-desktop" },
|
|
18018
|
+
{ label: "Tool Reference", slug: "mcp-talonic-extract" }
|
|
18019
|
+
],
|
|
18020
|
+
faq: [
|
|
18021
|
+
{ question: "How do I add Talonic MCP to Cowork?", answer: "Open Cowork settings, go to MCP Servers, click Add, and paste the standard Talonic config with your API key." }
|
|
18022
|
+
],
|
|
18023
|
+
mentions: ["Cowork"]
|
|
18024
|
+
},
|
|
18025
|
+
{
|
|
18026
|
+
slug: "mcp-talonic-extract",
|
|
18027
|
+
parentSlug: "mcp-tools",
|
|
18028
|
+
title: "talonic_extract",
|
|
18029
|
+
seoTitle: "talonic_extract MCP Tool \u2014 Talonic Docs",
|
|
18030
|
+
description: "Extract structured, schema-validated data from a document. Full input schema, output schema, confidence scores, and usage examples.",
|
|
18031
|
+
content: [
|
|
18032
|
+
{ type: "paragraph", text: "Extract structured, schema-validated data from a document. Returns clean JSON matching the schema, with per-field confidence scores and document metadata." },
|
|
18033
|
+
{ type: "heading", level: 3, text: "When to use" },
|
|
18034
|
+
{ type: "list", ordered: false, items: [
|
|
18035
|
+
"The user has a document (PDF, image, scan, DOCX) and wants specific fields pulled out.",
|
|
18036
|
+
"You need structured data (vendor name, total amount, dates, parties, terms) rather than free text.",
|
|
18037
|
+
"The user uploads or references any invoice, contract, certificate, statement, or form.",
|
|
18038
|
+
"You want validated JSON instead of trying to OCR + parse with raw LLM calls."
|
|
18039
|
+
] },
|
|
18040
|
+
{ type: "heading", level: 3, text: "When NOT to use" },
|
|
18041
|
+
{ type: "list", ordered: false, items: [
|
|
18042
|
+
"The user just wants full text content \u2192 use `talonic_to_markdown`.",
|
|
18043
|
+
"The user wants to find documents matching a query \u2192 use `talonic_search` or `talonic_filter`."
|
|
18044
|
+
] },
|
|
18045
|
+
{ type: "heading", level: 3, text: "Input schema" },
|
|
18046
|
+
{ type: "param-table", title: "File source (provide exactly one)", params: [
|
|
18047
|
+
{ name: "file_data", type: "string", description: "Base64-encoded file bytes. **Recommended for chat clients** (Claude Desktop, Cursor). Pair with `filename` for MIME type inference." },
|
|
18048
|
+
{ name: "filename", type: "string", description: "Original filename with extension, e.g. `invoice.pdf`. Required when using `file_data`." },
|
|
18049
|
+
{ name: "file_path", type: "string", description: "Local filesystem path. Only works if the MCP server process can read it \u2014 sandboxed clients should use `file_data` instead." },
|
|
18050
|
+
{ name: "file_url", type: "string", description: "Public URL. The Talonic API fetches it server-side." },
|
|
18051
|
+
{ name: "document_id", type: "string", description: "Re-extract an already-uploaded document with a new schema." }
|
|
18052
|
+
] },
|
|
18053
|
+
{ type: "param-table", title: "Schema (provide at most one)", params: [
|
|
18054
|
+
{ name: "schema", type: "object", description: 'Inline schema definition. **Use full JSON Schema format** (`{type: "object", properties: {...}}`) for best results. Flat key-type maps (`{vendor_name: "string"}`) are accepted but normalized server-side \u2014 if you get a \'no fields\' error, switch to full JSON Schema.' },
|
|
18055
|
+
{ name: "schema_id", type: "string", description: "ID of a saved schema. Accepts UUID or `SCH-XXXXXXXX` short ID. Mutually exclusive with `schema`." }
|
|
18056
|
+
] },
|
|
18057
|
+
{ type: "param-table", title: "Options", params: [
|
|
18058
|
+
{ name: "instructions", type: "string", description: "Natural-language guidance for the extractor, e.g. `Focus on the billing section. Amounts are in EUR.`" },
|
|
18059
|
+
{ name: "include_markdown", type: "boolean", description: "Include OCR-converted markdown alongside structured data in the response." }
|
|
18060
|
+
] },
|
|
18061
|
+
{ type: "heading", level: 3, text: "Response shape" },
|
|
18062
|
+
{ type: "code", language: "json", title: "Example response", code: '{\n "data": {\n "vendor_name": "Acme Corp",\n "invoice_number": "INV-2024-0847",\n "total_amount": 14250.00,\n "due_date": "2024-03-15"\n },\n "confidence": {\n "vendor_name": 0.97,\n "invoice_number": 0.99,\n "total_amount": 0.94,\n "due_date": 0.91\n },\n "document": {\n "id": "d_abc123",\n "filename": "invoice.pdf",\n "documentType": "invoice",\n "language": "en",\n "pageCount": 2\n },\n "extraction": {\n "id": "ext_xyz789",\n "schemaId": "sch_def456"\n }\n}' },
|
|
18063
|
+
{ type: "heading", level: 3, text: "Confidence scores and human escalation" },
|
|
18064
|
+
{ type: "paragraph", text: "Each field in the `confidence` object is a float from 0.0 to 1.0. Values above **0.90** are high confidence. Values between **0.70\u20130.90** should be treated with caution \u2014 flag them to the user for verification. Values below **0.70** indicate low confidence \u2014 the agent should ask the user to verify the value or re-extract with more specific instructions." },
|
|
18065
|
+
{ type: "callout", variant: "warning", text: "Always provide either a `schema` or `schema_id`. Auto-discovery (no schema) currently returns 500 on production." },
|
|
18066
|
+
{ type: "heading", level: 3, text: "Cost" },
|
|
18067
|
+
{ type: "paragraph", text: "Each `talonic_extract` call with a new file consumes **one extraction credit**. Re-extracting the same `document_id` with a different schema also consumes one credit. To avoid unnecessary cost, check if a document has already been extracted before calling again \u2014 use `talonic_search` or `talonic_filter` to find existing results." },
|
|
18068
|
+
{ type: "heading", level: 3, text: "Errors" },
|
|
18069
|
+
{ type: "param-table", title: "Common errors", params: [
|
|
18070
|
+
{ name: "unauthorized", type: "401", description: "Invalid or missing API key." },
|
|
18071
|
+
{ name: "validation_error", type: "422", description: "Missing schema, invalid schema format, or no file source provided." },
|
|
18072
|
+
{ name: "unsupported_file_type", type: "422", description: "MIME type inferred as `application/octet-stream`. Ensure the filename has a recognized extension (pdf, docx, png, jpg, etc.)." },
|
|
18073
|
+
{ name: "rate_limit_exceeded", type: "429", description: "Too many requests. The SDK retries automatically with backoff." },
|
|
18074
|
+
{ name: "insufficient_credits", type: "402", description: "Extraction credit balance exhausted. Upgrade plan or wait for daily reset (free tier)." }
|
|
18075
|
+
] }
|
|
18076
|
+
],
|
|
18077
|
+
related: [
|
|
18078
|
+
{ label: "SDK Extract", slug: "sdk-extract" },
|
|
18079
|
+
{ label: "POST /v1/extract", slug: "post-extract" },
|
|
18080
|
+
{ label: "Cost & Rate Limits", slug: "mcp-cost-and-limits" }
|
|
18081
|
+
],
|
|
18082
|
+
faq: [
|
|
18083
|
+
{ question: "What does talonic_extract return?", answer: "Structured JSON matching your schema, per-field confidence scores (0.0\u20131.0), document metadata (type, language, page count), and extraction/schema IDs for follow-up calls." },
|
|
18084
|
+
{ question: "How do I handle low confidence scores?", answer: "Scores above 0.90 are reliable. Between 0.70\u20130.90, flag to the user for verification. Below 0.70, ask the user to verify or re-extract with more specific instructions." }
|
|
18085
|
+
],
|
|
18086
|
+
mentions: ["talonic_extract", "file_data", "schema", "confidence", "extraction"]
|
|
18087
|
+
},
|
|
18088
|
+
{
|
|
18089
|
+
slug: "mcp-talonic-search",
|
|
18090
|
+
parentSlug: "mcp-tools",
|
|
18091
|
+
title: "talonic_search",
|
|
18092
|
+
seoTitle: "talonic_search MCP Tool \u2014 Talonic Docs",
|
|
18093
|
+
description: "Omnisearch across documents, fields, sources, and schemas. Full input/output schema, examples, and usage guidance.",
|
|
18094
|
+
content: [
|
|
18095
|
+
{ type: "paragraph", text: "Omnisearch across documents, extracted field values, field names, sources, and schemas in the workspace. Returns ranked results across all entity types in one call." },
|
|
18096
|
+
{ type: "heading", level: 3, text: "When to use" },
|
|
18097
|
+
{ type: "list", ordered: false, items: [
|
|
18098
|
+
"The user wants to find documents but doesn't know the exact filename or ID.",
|
|
18099
|
+
"The query is conceptual: 'contracts mentioning indemnification', 'Acme invoices'.",
|
|
18100
|
+
"You need to narrow a large workspace before calling `talonic_extract` or `talonic_filter`.",
|
|
18101
|
+
"The user asks 'do I have any docs about X' or 'find anything related to X'.",
|
|
18102
|
+
"You need to discover canonical field names before using `talonic_filter`."
|
|
18103
|
+
] },
|
|
18104
|
+
{ type: "heading", level: 3, text: "When NOT to use" },
|
|
18105
|
+
{ type: "list", ordered: false, items: [
|
|
18106
|
+
"The user has a specific `document_id` \u2192 use `talonic_get_document`.",
|
|
18107
|
+
"The user wants structured field-value filters like 'amount > 1000' \u2192 use `talonic_filter`.",
|
|
18108
|
+
"The user wants to extract data from a new document \u2192 use `talonic_extract`."
|
|
18109
|
+
] },
|
|
18110
|
+
{ type: "heading", level: 3, text: "Input schema" },
|
|
18111
|
+
{ type: "param-table", title: "Parameters", params: [
|
|
18112
|
+
{ name: "query", type: "string", required: true, description: "Natural-language search query, e.g. `indemnification clauses` or `Acme invoices Q4`." },
|
|
18113
|
+
{ name: "limit", type: "number", description: "Maximum results per entity type. Default: 5. Increase for broader exploration." }
|
|
18114
|
+
] },
|
|
18115
|
+
{ type: "heading", level: 3, text: "Response shape" },
|
|
18116
|
+
{ type: "code", language: "json", title: "Example response", code: '{\n "documents": [\n {\n "id": "d_abc123",\n "filename": "acme-invoice-q4.pdf",\n "documentType": "invoice",\n "score": 0.92\n }\n ],\n "fieldMatches": [\n {\n "documentId": "d_abc123",\n "fieldName": "vendor.name",\n "canonicalName": "vendor.name",\n "value": "Acme Corp",\n "score": 0.88\n }\n ],\n "sources": [],\n "schemas": [\n {\n "id": "sch_def456",\n "name": "Standard Invoice",\n "score": 0.75\n }\n ],\n "fields": [\n {\n "id": "f_ghi789",\n "canonicalName": "vendor.name",\n "displayName": "Vendor Name",\n "score": 0.85\n }\n ]\n}' },
|
|
18117
|
+
{ type: "callout", text: "The `fields[].canonicalName` values are what you pass to `talonic_filter` as the `field` parameter. Always use search to discover field names before filtering." },
|
|
18118
|
+
{ type: "heading", level: 3, text: "Cost" },
|
|
18119
|
+
{ type: "paragraph", text: "Search calls are **free** \u2014 they do not consume extraction credits. Use search liberally to explore before extracting." },
|
|
18120
|
+
{ type: "heading", level: 3, text: "Errors" },
|
|
18121
|
+
{ type: "param-table", title: "Common errors", params: [
|
|
18122
|
+
{ name: "unauthorized", type: "401", description: "Invalid or missing API key." },
|
|
18123
|
+
{ name: "validation_error", type: "422", description: "Empty or missing `query` parameter." }
|
|
18124
|
+
] }
|
|
18125
|
+
],
|
|
18126
|
+
related: [
|
|
18127
|
+
{ label: "talonic_filter", slug: "mcp-talonic-filter" },
|
|
18128
|
+
{ label: "Omnisearch", slug: "omnisearch" }
|
|
18129
|
+
],
|
|
18130
|
+
faq: [
|
|
18131
|
+
{ question: "Does talonic_search cost credits?", answer: "No. Search calls are free and do not consume extraction credits." },
|
|
18132
|
+
{ question: "What entities does talonic_search return?", answer: "Documents, field matches (with canonical names and values), sources, schemas, and field definitions \u2014 all ranked by relevance score." }
|
|
18133
|
+
],
|
|
18134
|
+
mentions: ["talonic_search", "omnisearch", "canonicalName", "field discovery"]
|
|
18135
|
+
},
|
|
18136
|
+
{
|
|
18137
|
+
slug: "mcp-talonic-filter",
|
|
18138
|
+
parentSlug: "mcp-tools",
|
|
18139
|
+
title: "talonic_filter",
|
|
18140
|
+
seoTitle: "talonic_filter MCP Tool \u2014 Talonic Docs",
|
|
18141
|
+
description: "Filter documents by extracted field values. Full operator reference, input/output schema, and composable condition examples.",
|
|
18142
|
+
content: [
|
|
18143
|
+
{ type: "paragraph", text: "Filter documents by extracted field values using composable conditions. Conditions accept canonical field names (e.g. `vendor.name`, `policy.0_coverage_type`) or field UUIDs. The Talonic API resolves names to IDs server-side." },
|
|
18144
|
+
{ type: "heading", level: 3, text: "When to use" },
|
|
18145
|
+
{ type: "list", ordered: false, items: [
|
|
18146
|
+
"The user wants documents matching specific structured criteria: 'invoices over 1000 EUR', 'contracts expiring before 2026-12-31', 'COIs from Acme'.",
|
|
18147
|
+
"The query is value-based on extracted fields, not a free-text concept search.",
|
|
18148
|
+
"You need a sortable, paginated list filtered by field conditions."
|
|
18149
|
+
] },
|
|
18150
|
+
{ type: "heading", level: 3, text: "When NOT to use" },
|
|
18151
|
+
{ type: "list", ordered: false, items: [
|
|
18152
|
+
"The user wants conceptual / free-text search \u2192 use `talonic_search`.",
|
|
18153
|
+
"The user wants a single document by ID \u2192 use `talonic_get_document`.",
|
|
18154
|
+
"The user wants to extract from a new document \u2192 use `talonic_extract`."
|
|
18155
|
+
] },
|
|
18156
|
+
{ type: "heading", level: 3, text: "Input schema" },
|
|
18157
|
+
{ type: "param-table", title: "Top-level parameters", params: [
|
|
18158
|
+
{ name: "conditions", type: "array", required: true, description: "One or more filter conditions, AND-ed together." },
|
|
18159
|
+
{ name: "search", type: "string", description: "Optional free-text search applied alongside the filters." },
|
|
18160
|
+
{ name: "sort", type: "object", description: "Optional sort: `{ field, direction }` where direction is `asc` or `desc`." },
|
|
18161
|
+
{ name: "page", type: "number", description: "Page number for pagination (1-based)." },
|
|
18162
|
+
{ name: "limit", type: "number", description: "Results per page. Default: 50." },
|
|
18163
|
+
{ name: "source_connection_id", type: "string", description: "Optionally scope to a specific source connection." }
|
|
18164
|
+
] },
|
|
18165
|
+
{ type: "param-table", title: "Condition object", params: [
|
|
18166
|
+
{ name: "field", type: "string", description: "Canonical field name (e.g. `vendor.name`). Mutually exclusive with `field_id`. Discover via `talonic_search`." },
|
|
18167
|
+
{ name: "field_id", type: "string", description: "Talonic field UUID. Mutually exclusive with `field`." },
|
|
18168
|
+
{ name: "operator", type: "string", required: true, description: "One of: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `between`, `contains`, `is_empty`, `is_not_empty`." },
|
|
18169
|
+
{ name: "value", type: "any", description: "Value to compare against. Not needed for `is_empty` / `is_not_empty`." },
|
|
18170
|
+
{ name: "value_to", type: "any", description: "Upper bound for `between` operator; ignored otherwise." }
|
|
18171
|
+
] },
|
|
18172
|
+
{ type: "heading", level: 3, text: "Operator reference" },
|
|
18173
|
+
{ type: "param-table", title: "Operators", params: [
|
|
18174
|
+
{ name: "eq", type: "=", description: "Exact equality." },
|
|
18175
|
+
{ name: "neq", type: "!=", description: "Not equal." },
|
|
18176
|
+
{ name: "gt / gte", type: "> / >=", description: "Greater than (or equal). Works on numbers and dates." },
|
|
18177
|
+
{ name: "lt / lte", type: "< / <=", description: "Less than (or equal). Works on numbers and dates." },
|
|
18178
|
+
{ name: "between", type: "range", description: "Inclusive range. Requires both `value` (lower) and `value_to` (upper)." },
|
|
18179
|
+
{ name: "contains", type: "substring", description: "Case-insensitive substring match on string fields." },
|
|
18180
|
+
{ name: "is_empty", type: "null check", description: "Field has no value." },
|
|
18181
|
+
{ name: "is_not_empty", type: "presence", description: "Field has a value. **Note:** currently underreports \u2014 use a more specific operator when possible." }
|
|
18182
|
+
] },
|
|
18183
|
+
{ type: "heading", level: 3, text: "Example" },
|
|
18184
|
+
{ type: "code", language: "json", title: "Find invoices over 1000 from Acme", code: '{\n "conditions": [\n { "field": "vendor.name", "operator": "contains", "value": "Acme" },\n { "field": "total_amount", "operator": "gt", "value": 1000 }\n ],\n "sort": { "field": "total_amount", "direction": "desc" },\n "limit": 10\n}' },
|
|
18185
|
+
{ type: "heading", level: 3, text: "Response shape" },
|
|
18186
|
+
{ type: "code", language: "json", title: "Example response", code: '{\n "documents": [\n {\n "id": "d_abc123",\n "filename": "acme-invoice-q4.pdf",\n "documentType": "invoice",\n "extractedFields": {\n "vendor.name": "Acme Corp",\n "total_amount": 14250.00\n }\n }\n ],\n "total": 1,\n "page": 1,\n "perPage": 10\n}' },
|
|
18187
|
+
{ type: "heading", level: 3, text: "Cost" },
|
|
18188
|
+
{ type: "paragraph", text: "Filter calls are **free** \u2014 they query already-extracted data and do not consume extraction credits." },
|
|
18189
|
+
{ type: "heading", level: 3, text: "Errors" },
|
|
18190
|
+
{ type: "param-table", title: "Common errors", params: [
|
|
18191
|
+
{ name: "unauthorized", type: "401", description: "Invalid or missing API key." },
|
|
18192
|
+
{ name: "no_field_match", type: "422", description: "Field name not found. Use `talonic_search` to discover canonical field names first." },
|
|
18193
|
+
{ name: "validation_error", type: "422", description: "Missing conditions array, invalid operator, or missing `value` for operators that require it." }
|
|
18194
|
+
] }
|
|
18195
|
+
],
|
|
18196
|
+
related: [
|
|
18197
|
+
{ label: "talonic_search", slug: "mcp-talonic-search" },
|
|
18198
|
+
{ label: "Filter & Search API", slug: "field-autocomplete" }
|
|
18199
|
+
],
|
|
18200
|
+
faq: [
|
|
18201
|
+
{ question: "Does talonic_filter cost credits?", answer: "No. Filter queries already-extracted data and is free." },
|
|
18202
|
+
{ question: "How do I find field names for filtering?", answer: "Call talonic_search first. The fields[].canonicalName values from the response are what you pass as the field parameter in filter conditions." }
|
|
18203
|
+
],
|
|
18204
|
+
mentions: ["talonic_filter", "filter", "conditions", "operators", "canonical field name"]
|
|
18205
|
+
},
|
|
18206
|
+
{
|
|
18207
|
+
slug: "mcp-talonic-get-document",
|
|
18208
|
+
parentSlug: "mcp-tools",
|
|
18209
|
+
title: "talonic_get_document",
|
|
18210
|
+
seoTitle: "talonic_get_document MCP Tool \u2014 Talonic Docs",
|
|
18211
|
+
description: "Fetch full metadata for a single document by ID, including processing log and link URLs.",
|
|
18212
|
+
content: [
|
|
18213
|
+
{ type: "paragraph", text: "Fetch full metadata for a single document by ID. Returns filename, page count, detected document type, language, processing log, and link URLs." },
|
|
18214
|
+
{ type: "heading", level: 3, text: "When to use" },
|
|
18215
|
+
{ type: "list", ordered: false, items: [
|
|
18216
|
+
"You need details about a specific document already extracted or uploaded.",
|
|
18217
|
+
"You have a `document_id` from a previous extract or search and want more context.",
|
|
18218
|
+
"The user asks 'tell me about document X'."
|
|
18219
|
+
] },
|
|
18220
|
+
{ type: "heading", level: 3, text: "When NOT to use" },
|
|
18221
|
+
{ type: "list", ordered: false, items: [
|
|
18222
|
+
"The user wants full text content \u2192 use `talonic_to_markdown`.",
|
|
18223
|
+
"The user wants extracted structured data \u2192 use `talonic_extract`.",
|
|
18224
|
+
"The user has a file but no `document_id` yet \u2192 call `talonic_extract` first."
|
|
18225
|
+
] },
|
|
18226
|
+
{ type: "heading", level: 3, text: "Input schema" },
|
|
18227
|
+
{ type: "param-table", title: "Parameters", params: [
|
|
18228
|
+
{ name: "document_id", type: "string", required: true, description: "The Talonic document ID. Get this from a previous `talonic_extract` or `talonic_search` response." }
|
|
18229
|
+
] },
|
|
18230
|
+
{ type: "heading", level: 3, text: "Response shape" },
|
|
18231
|
+
{ type: "code", language: "json", title: "Example response", code: '{\n "id": "d_abc123",\n "filename": "invoice.pdf",\n "documentType": "invoice",\n "language": "en",\n "pageCount": 2,\n "processingLog": [...],\n "links": {\n "self": "https://api.talonic.com/v1/documents/d_abc123",\n "extractions": "https://api.talonic.com/v1/documents/d_abc123/extractions",\n "dashboard": "https://app.talonic.com/documents/d_abc123"\n }\n}' },
|
|
18232
|
+
{ type: "heading", level: 3, text: "Cost" },
|
|
18233
|
+
{ type: "paragraph", text: "Free \u2014 metadata lookups do not consume extraction credits." }
|
|
18234
|
+
],
|
|
18235
|
+
related: [
|
|
18236
|
+
{ label: "SDK Documents", slug: "sdk-documents" },
|
|
18237
|
+
{ label: "Get Document", slug: "get-document" }
|
|
18238
|
+
],
|
|
18239
|
+
faq: [],
|
|
18240
|
+
mentions: ["talonic_get_document", "metadata", "document_id"]
|
|
18241
|
+
},
|
|
18242
|
+
{
|
|
18243
|
+
slug: "mcp-talonic-to-markdown",
|
|
18244
|
+
parentSlug: "mcp-tools",
|
|
18245
|
+
title: "talonic_to_markdown",
|
|
18246
|
+
seoTitle: "talonic_to_markdown MCP Tool \u2014 Talonic Docs",
|
|
18247
|
+
description: "Get OCR-converted markdown for a document. Full input schema, file source options, cost guidance, and usage examples.",
|
|
18248
|
+
content: [
|
|
18249
|
+
{ type: "paragraph", text: "Get OCR-converted markdown for a document. Accepts an existing `document_id` (cheapest \u2014 one API call, no re-processing), or raw file bytes, a local path, or a URL." },
|
|
18250
|
+
{ type: "heading", level: 3, text: "When to use" },
|
|
18251
|
+
{ type: "list", ordered: false, items: [
|
|
18252
|
+
"The user wants the full text content of a document for summarisation, translation, or analysis.",
|
|
18253
|
+
"A previous tool call returned a `document_id` and you want to inspect its content.",
|
|
18254
|
+
"The user asks 'what does the document say' or 'summarise this PDF'.",
|
|
18255
|
+
"The user has a raw PDF / scan / image and wants markdown directly without designing a schema."
|
|
18256
|
+
] },
|
|
18257
|
+
{ type: "heading", level: 3, text: "When NOT to use" },
|
|
18258
|
+
{ type: "list", ordered: false, items: [
|
|
18259
|
+
"The user wants specific structured fields \u2192 use `talonic_extract` with a schema."
|
|
18260
|
+
] },
|
|
18261
|
+
{ type: "heading", level: 3, text: "Input schema" },
|
|
18262
|
+
{ type: "paragraph", text: "Provide **exactly one** of the following:" },
|
|
18263
|
+
{ type: "param-table", title: "Parameters", params: [
|
|
18264
|
+
{ name: "document_id", type: "string", description: "ID of an already-ingested document. **Cheapest path** \u2014 one API call, no re-processing or credit usage." },
|
|
18265
|
+
{ name: "file_data", type: "string", description: "Base64-encoded file bytes. **Recommended for chat clients.** Pair with `filename`. Consumes one extraction credit (auto-ingests the file first)." },
|
|
18266
|
+
{ name: "filename", type: "string", description: "Original filename with extension. Required when using `file_data`." },
|
|
18267
|
+
{ name: "file_path", type: "string", description: "Local path. Only works if the MCP server has read access." },
|
|
18268
|
+
{ name: "file_url", type: "string", description: "Public URL. Talonic API fetches server-side. Consumes one extraction credit." }
|
|
18269
|
+
] },
|
|
18270
|
+
{ type: "heading", level: 3, text: "Response shape" },
|
|
18271
|
+
{ type: "code", language: "json", title: "Example response", code: '{\n "documentId": "d_abc123",\n "markdown": "# Invoice INV-2024-0847\\n\\n**Vendor:** Acme Corp\\n**Date:** 2024-01-15\\n\\n| Item | Qty | Unit Price | Total |\\n|------|-----|------------|-------|\\n| Widget A | 100 | 42.50 | 4,250.00 |\\n| Widget B | 200 | 50.00 | 10,000.00 |\\n\\n**Total: 14,250.00 EUR**"\n}' },
|
|
18272
|
+
{ type: "heading", level: 3, text: "Cost" },
|
|
18273
|
+
{ type: "paragraph", text: "**Free when using `document_id`** \u2014 the document is already ingested. When passing a raw file (`file_data`, `file_path`, `file_url`), the tool auto-ingests via extract first, consuming **one extraction credit**. To avoid unnecessary cost: if you've already extracted a document, reuse the `document_id` from that response." },
|
|
18274
|
+
{ type: "heading", level: 3, text: "Errors" },
|
|
18275
|
+
{ type: "param-table", title: "Common errors", params: [
|
|
18276
|
+
{ name: "missing_input_source", type: "client", description: "No file source provided. Provide exactly one of `document_id`, `file_data`, `file_path`, `file_url`." },
|
|
18277
|
+
{ name: "multiple_input_sources", type: "client", description: "More than one file source provided." },
|
|
18278
|
+
{ name: "not_found", type: "404", description: "The `document_id` does not exist in the workspace." },
|
|
18279
|
+
{ name: "unsupported_file_type", type: "422", description: "Unrecognized file extension. Use a known extension (pdf, docx, png, jpg, etc.)." }
|
|
18280
|
+
] }
|
|
18281
|
+
],
|
|
18282
|
+
related: [
|
|
18283
|
+
{ label: "talonic_extract", slug: "mcp-talonic-extract" },
|
|
18284
|
+
{ label: "SDK getMarkdown", slug: "sdk-documents" }
|
|
18285
|
+
],
|
|
18286
|
+
faq: [
|
|
18287
|
+
{ question: "Does talonic_to_markdown cost credits?", answer: "Free when using document_id (already ingested). Costs one extraction credit when passing a raw file, since the file must be ingested first." },
|
|
18288
|
+
{ question: "How do I avoid paying twice for markdown?", answer: "If you already called talonic_extract, reuse the document_id from that response to call talonic_to_markdown for free." }
|
|
18289
|
+
],
|
|
18290
|
+
mentions: ["talonic_to_markdown", "OCR", "markdown", "document_id"]
|
|
18291
|
+
},
|
|
18292
|
+
{
|
|
18293
|
+
slug: "mcp-talonic-list-schemas",
|
|
18294
|
+
parentSlug: "mcp-tools",
|
|
18295
|
+
title: "talonic_list_schemas",
|
|
18296
|
+
seoTitle: "talonic_list_schemas MCP Tool \u2014 Talonic Docs",
|
|
18297
|
+
description: "List all saved schemas with IDs, names, descriptions, field counts, and full JSON Schema definitions.",
|
|
18298
|
+
content: [
|
|
18299
|
+
{ type: "paragraph", text: "List all saved schemas in the workspace. Returns each schema with its ID, name, description, version, field count, and full JSON Schema definition." },
|
|
18300
|
+
{ type: "heading", level: 3, text: "When to use" },
|
|
18301
|
+
{ type: "list", ordered: false, items: [
|
|
18302
|
+
"The user asks what schemas they have, or wants to see existing schemas.",
|
|
18303
|
+
"Before designing a new schema, check if one already covers the use case.",
|
|
18304
|
+
"The user asks to extract from a known document type \u2014 find a matching saved schema.",
|
|
18305
|
+
"You need a `schema_id` for `talonic_extract`."
|
|
18306
|
+
] },
|
|
18307
|
+
{ type: "heading", level: 3, text: "When NOT to use" },
|
|
18308
|
+
{ type: "list", ordered: false, items: [
|
|
18309
|
+
"The user wants to extract data and provides an inline schema \u2192 call `talonic_extract` directly."
|
|
18310
|
+
] },
|
|
18311
|
+
{ type: "heading", level: 3, text: "Input schema" },
|
|
18312
|
+
{ type: "paragraph", text: "No parameters required." },
|
|
18313
|
+
{ type: "heading", level: 3, text: "Cost" },
|
|
18314
|
+
{ type: "paragraph", text: "Free \u2014 listing schemas does not consume extraction credits." }
|
|
18315
|
+
],
|
|
18316
|
+
related: [
|
|
18317
|
+
{ label: "talonic_save_schema", slug: "mcp-talonic-save-schema" },
|
|
18318
|
+
{ label: "SDK Schemas", slug: "sdk-schemas" }
|
|
18319
|
+
],
|
|
18320
|
+
faq: [],
|
|
18321
|
+
mentions: ["talonic_list_schemas", "schemas", "schema_id"]
|
|
18322
|
+
},
|
|
18323
|
+
{
|
|
18324
|
+
slug: "mcp-talonic-save-schema",
|
|
18325
|
+
parentSlug: "mcp-tools",
|
|
18326
|
+
title: "talonic_save_schema",
|
|
18327
|
+
seoTitle: "talonic_save_schema MCP Tool \u2014 Talonic Docs",
|
|
18328
|
+
description: "Save a schema definition to the workspace for reuse. Full input schema, definition formats, and examples.",
|
|
18329
|
+
content: [
|
|
18330
|
+
{ type: "paragraph", text: "Save a schema definition to the workspace for reuse across future extractions. Returns the saved schema with its assigned `id` (UUID) and `short_id` (`SCH-XXXXXXXX`)." },
|
|
18331
|
+
{ type: "heading", level: 3, text: "When to use" },
|
|
18332
|
+
{ type: "list", ordered: false, items: [
|
|
18333
|
+
"The user asks to save a schema, store a template, or reuse the schema across docs.",
|
|
18334
|
+
"You have iterated on a schema with the user and they confirmed it should be saved.",
|
|
18335
|
+
"The user wants to standardise extraction across many documents of the same type."
|
|
18336
|
+
] },
|
|
18337
|
+
{ type: "heading", level: 3, text: "When NOT to use" },
|
|
18338
|
+
{ type: "list", ordered: false, items: [
|
|
18339
|
+
"The user just wants to extract once with an inline schema \u2192 call `talonic_extract` directly.",
|
|
18340
|
+
"The user has not confirmed the schema design \u2014 avoid creating clutter."
|
|
18341
|
+
] },
|
|
18342
|
+
{ type: "heading", level: 3, text: "Input schema" },
|
|
18343
|
+
{ type: "param-table", title: "Parameters", params: [
|
|
18344
|
+
{ name: "name", type: "string", required: true, description: "Human-readable name, e.g. `Standard Invoice`." },
|
|
18345
|
+
{ name: "definition", type: "object", required: true, description: "Schema definition. **Use full JSON Schema format** (`{type: \"object\", properties: {...}}`) for best results. Flat key-type maps are accepted but normalized server-side \u2014 if you get a 'no fields' error, switch to full JSON Schema." },
|
|
18346
|
+
{ name: "description", type: "string", description: "Optional description of what this schema extracts." }
|
|
18347
|
+
] },
|
|
18348
|
+
{ type: "heading", level: 3, text: "Schema format guidance" },
|
|
18349
|
+
{ type: "paragraph", text: "**Full JSON Schema (recommended):**" },
|
|
18350
|
+
{ type: "code", language: "json", title: "JSON Schema format", code: '{\n "type": "object",\n "properties": {\n "vendor_name": { "type": "string" },\n "total_amount": { "type": "number" },\n "line_items": {\n "type": "array",\n "items": {\n "type": "object",\n "properties": {\n "description": { "type": "string" },\n "quantity": { "type": "number" },\n "unit_price": { "type": "number" }\n }\n }\n }\n }\n}' },
|
|
18351
|
+
{ type: "paragraph", text: "**Flat key-type map (convenience, normalized server-side):**" },
|
|
18352
|
+
{ type: "code", language: "json", title: "Flat format", code: '{\n "vendor_name": "string",\n "total_amount": "number",\n "due_date": "date"\n}' },
|
|
18353
|
+
{ type: "callout", variant: "warning", text: "Flat key-type maps are normalized to JSON Schema server-side. If you encounter a 'no fields' error, switch to full JSON Schema format. For schemas with nested objects or arrays, always use full JSON Schema." },
|
|
18354
|
+
{ type: "heading", level: 3, text: "Cost" },
|
|
18355
|
+
{ type: "paragraph", text: "Free \u2014 saving a schema does not consume extraction credits." }
|
|
18356
|
+
],
|
|
18357
|
+
related: [
|
|
18358
|
+
{ label: "talonic_list_schemas", slug: "mcp-talonic-list-schemas" },
|
|
18359
|
+
{ label: "Schemas API", slug: "create-schema" }
|
|
18360
|
+
],
|
|
18361
|
+
faq: [
|
|
18362
|
+
{ question: "What schema format should I use?", answer: "Full JSON Schema ({type: 'object', properties: {...}}) is most reliable. Flat key-type maps ({field: 'type'}) work for simple schemas but are normalized server-side and may produce errors with complex structures." }
|
|
18363
|
+
],
|
|
18364
|
+
mentions: ["talonic_save_schema", "schema", "JSON Schema", "flat key-type"]
|
|
18365
|
+
},
|
|
18366
|
+
{
|
|
18367
|
+
slug: "mcp-schemas-resource",
|
|
18368
|
+
parentSlug: "mcp-resources",
|
|
18369
|
+
title: "talonic://schemas",
|
|
18370
|
+
seoTitle: "talonic://schemas MCP Resource \u2014 Talonic Docs",
|
|
18371
|
+
description: "The MCP resource URI that exposes saved schemas to clients that browse resources separately, like Claude Desktop and Cowork.",
|
|
18372
|
+
content: [
|
|
18373
|
+
{ type: "paragraph", text: "The `talonic://schemas` resource exposes the saved-schemas list to clients that browse MCP resources separately. Claude Desktop and Cowork render these in the UI." }
|
|
18374
|
+
],
|
|
18375
|
+
related: [
|
|
18376
|
+
{ label: "talonic_list_schemas", slug: "mcp-talonic-list-schemas" }
|
|
18377
|
+
],
|
|
18378
|
+
faq: [],
|
|
18379
|
+
mentions: ["MCP resource", "talonic://schemas"]
|
|
18380
|
+
},
|
|
18381
|
+
{
|
|
18382
|
+
slug: "mcp-cost-and-limits",
|
|
18383
|
+
parentSlug: "mcp-advanced",
|
|
18384
|
+
title: "Cost & Rate Limits",
|
|
18385
|
+
seoTitle: "MCP Cost and Rate Limits \u2014 Talonic Docs",
|
|
18386
|
+
description: "Which MCP tool calls cost extraction credits, rate limit behavior, insufficient-credit handling, and how to avoid re-extraction.",
|
|
18387
|
+
content: [
|
|
18388
|
+
{ type: "heading", level: 3, text: "What costs credits" },
|
|
18389
|
+
{ type: "paragraph", text: "Only extraction operations consume credits. Everything else is free:" },
|
|
18390
|
+
{ type: "param-table", title: "Credit cost per tool", params: [
|
|
18391
|
+
{ name: "talonic_extract", type: "1 credit", description: "Each call with a new file or re-extraction of an existing document." },
|
|
18392
|
+
{ name: "talonic_to_markdown (raw file)", type: "1 credit", description: "When passing `file_data`, `file_path`, or `file_url` \u2014 auto-ingests first." },
|
|
18393
|
+
{ name: "talonic_to_markdown (document_id)", type: "free", description: "Document already ingested \u2014 just fetches stored markdown." },
|
|
18394
|
+
{ name: "talonic_search", type: "free", description: "Queries indexed data." },
|
|
18395
|
+
{ name: "talonic_filter", type: "free", description: "Queries extracted field values." },
|
|
18396
|
+
{ name: "talonic_get_document", type: "free", description: "Metadata lookup." },
|
|
18397
|
+
{ name: "talonic_list_schemas", type: "free", description: "Lists saved schemas." },
|
|
18398
|
+
{ name: "talonic_save_schema", type: "free", description: "Persists a schema definition." }
|
|
18399
|
+
] },
|
|
18400
|
+
{ type: "heading", level: 3, text: "Avoiding re-extraction" },
|
|
18401
|
+
{ type: "paragraph", text: "Agents should avoid extracting the same document twice. Best practices:" },
|
|
18402
|
+
{ type: "list", ordered: false, items: [
|
|
18403
|
+
"After calling `talonic_extract`, save the returned `document.id` and `extraction.id`. Use these for follow-up calls (`talonic_to_markdown`, `talonic_get_document`) instead of re-uploading the file.",
|
|
18404
|
+
"Before extracting, call `talonic_search` to check if the document already exists in the workspace.",
|
|
18405
|
+
"Use `talonic_filter` to query already-extracted data instead of re-extracting with a different schema when the fields you need are already captured."
|
|
18406
|
+
] },
|
|
18407
|
+
{ type: "heading", level: 3, text: "Rate limits" },
|
|
18408
|
+
{ type: "paragraph", text: "The Talonic API enforces per-key rate limits. When exceeded, the server returns `429 Too Many Requests` with a `X-RateLimit-Reset` header. The MCP server (and the underlying Node SDK) retries automatically with exponential backoff up to `maxRetries` (default: 3). If retries are exhausted, the tool returns an error with the reset timestamp." },
|
|
18409
|
+
{ type: "heading", level: 3, text: "Insufficient credits" },
|
|
18410
|
+
{ type: "paragraph", text: "When extraction credits are exhausted, the API returns `402 Payment Required`. The tool surfaces this as an error. The agent should inform the user that their credit balance is depleted and suggest upgrading their plan or waiting for the daily reset (free tier: 50 extractions/day, resets at midnight UTC)." },
|
|
18411
|
+
{ type: "heading", level: 3, text: "Free tier limits" },
|
|
18412
|
+
{ type: "paragraph", text: "The free tier includes 50 extractions per day (resets at midnight UTC). Search, filter, metadata, and schema operations are unlimited. No credit card required." }
|
|
18413
|
+
],
|
|
18414
|
+
related: [
|
|
18415
|
+
{ label: "talonic_extract", slug: "mcp-talonic-extract" },
|
|
18416
|
+
{ label: "Authentication", slug: "mcp-authentication" },
|
|
18417
|
+
{ label: "SDK Retries", slug: "sdk-retries" }
|
|
18418
|
+
],
|
|
18419
|
+
faq: [
|
|
18420
|
+
{ question: "Which MCP tool calls cost credits?", answer: "Only talonic_extract and talonic_to_markdown (with raw file) cost one credit each. Search, filter, get_document, list_schemas, and save_schema are all free." },
|
|
18421
|
+
{ question: "What happens when I run out of credits?", answer: "The API returns 402 Payment Required. The agent should inform the user and suggest upgrading their plan or waiting for the daily reset (free tier resets at midnight UTC)." },
|
|
18422
|
+
{ question: "How do rate limits work?", answer: "The API returns 429 with a reset timestamp. The SDK retries automatically with exponential backoff (up to 3 retries by default)." }
|
|
18423
|
+
],
|
|
18424
|
+
mentions: ["credits", "rate limits", "429", "402", "free tier", "cost"]
|
|
18425
|
+
},
|
|
18426
|
+
{
|
|
18427
|
+
slug: "mcp-drag-drop",
|
|
18428
|
+
parentSlug: "mcp-advanced",
|
|
18429
|
+
title: "Drag & Drop in Chat",
|
|
18430
|
+
seoTitle: "MCP Drag and Drop File Handling \u2014 Talonic Docs",
|
|
18431
|
+
description: "How file_data + filename solves the sandboxed file path problem for drag-and-drop in Claude Desktop, Cursor, and Cowork.",
|
|
18432
|
+
content: [
|
|
18433
|
+
{ type: "paragraph", text: "When a user drag-drops a file into a chat-style MCP host (Claude Desktop, Cowork, Cursor), the file lands in a host-owned sandbox directory the MCP server cannot read. The path the host hands the agent is meaningless to a separately-running `npx` MCP process." },
|
|
18434
|
+
{ type: "paragraph", text: "From `@talonic/mcp@0.1.4`, agents can pass **`file_data`** (base64-encoded file bytes) and **`filename`** on `talonic_extract` and `talonic_to_markdown`. The agent reads the file bytes from the conversation, base64-encodes them, and passes them through the MCP tool call. The MCP server decodes, infers MIME type from the filename, and uploads to the Talonic API as a normal multipart request." },
|
|
18435
|
+
{ type: "paragraph", text: "Tool descriptions advertise `file_data` as the recommended input for chat-style clients, so well-trained agents reach for it automatically. No client-side configuration required." }
|
|
18436
|
+
],
|
|
18437
|
+
related: [
|
|
18438
|
+
{ label: "talonic_extract", slug: "mcp-talonic-extract" },
|
|
18439
|
+
{ label: "Installation", slug: "mcp-installation" }
|
|
18440
|
+
],
|
|
18441
|
+
faq: [
|
|
18442
|
+
{ question: "How does file upload work in MCP chat clients?", answer: "From v0.1.4, agents pass file_data (base64) + filename instead of a file path. This handles drag-and-drop in sandboxed chat clients like Claude Desktop." }
|
|
18443
|
+
],
|
|
18444
|
+
mentions: ["drag and drop", "file_data", "base64", "sandbox"]
|
|
18445
|
+
},
|
|
18446
|
+
{
|
|
18447
|
+
slug: "mcp-architecture",
|
|
18448
|
+
parentSlug: "mcp-advanced",
|
|
18449
|
+
title: "Architecture",
|
|
18450
|
+
seoTitle: "MCP Server Architecture \u2014 Talonic Docs",
|
|
18451
|
+
description: "How the Talonic MCP server connects agents to the Talonic API. Hosted (HTTP) and local (stdio) transport modes.",
|
|
18452
|
+
content: [
|
|
18453
|
+
{ type: "paragraph", text: "The MCP server sits between the AI agent and the Talonic API:" },
|
|
18454
|
+
{ type: "code", language: "text", title: "Architecture", code: "Agent (Claude Desktop / Cursor / Cline / etc.)\n \u2193 MCP protocol (stdio or HTTP)\nTalonic MCP server\n \u2193 HTTPS, Bearer auth\napi.talonic.com" },
|
|
18455
|
+
{ type: "paragraph", text: "**Local mode (stdio):** The MCP client spawns the server as a child process. Communication is via stdin/stdout using the MCP protocol." },
|
|
18456
|
+
{ type: "paragraph", text: "**Hosted mode (HTTP):** The server runs at `mcp.talonic.com` using Streamable HTTP transport. Each `initialize` request creates a new session keyed by a UUID (`Mcp-Session-Id` header). Subsequent requests route to the same session. If a session is lost (deploy, restart), the server returns 404 and the client re-initializes \u2014 standard MCP reconnection." },
|
|
18457
|
+
{ type: "paragraph", text: "Each tool call is one HTTP request to the Talonic API using your API key. The server handles auth, retries on transient failures (429, 5xx), MIME-type detection on file uploads, multipart serialisation, and structured error formatting." }
|
|
18458
|
+
],
|
|
18459
|
+
related: [
|
|
18460
|
+
{ label: "Configuration", slug: "mcp-configuration" },
|
|
18461
|
+
{ label: "Introduction", slug: "mcp-introduction" }
|
|
18462
|
+
],
|
|
18463
|
+
faq: [],
|
|
18464
|
+
mentions: ["architecture", "stdio", "HTTP", "Streamable HTTP", "session"]
|
|
18465
|
+
},
|
|
18466
|
+
{
|
|
18467
|
+
slug: "mcp-configuration",
|
|
18468
|
+
parentSlug: "mcp-advanced",
|
|
18469
|
+
title: "Configuration",
|
|
18470
|
+
seoTitle: "MCP Server Configuration \u2014 Talonic Docs",
|
|
18471
|
+
description: "Environment variables for the local MCP server and header options for the hosted server.",
|
|
18472
|
+
content: [
|
|
18473
|
+
{ type: "heading", level: 3, text: "Local server (env vars)" },
|
|
18474
|
+
{ type: "paragraph", text: "Set via the `env` block in your MCP client config:" },
|
|
18475
|
+
{ type: "param-table", title: "Environment variables", params: [
|
|
18476
|
+
{ name: "TALONIC_API_KEY", type: "string", required: true, description: "Your Talonic API key. Starts with `tlnc_`." },
|
|
18477
|
+
{ name: "TALONIC_BASE_URL", type: "string", description: "Override the API base URL. Default: `https://api.talonic.com`." }
|
|
18478
|
+
] },
|
|
18479
|
+
{ type: "heading", level: 3, text: "Hosted server (headers)" },
|
|
18480
|
+
{ type: "paragraph", text: "The hosted server at `mcp.talonic.com` is configured entirely via the MCP client config:" },
|
|
18481
|
+
{ type: "code", language: "json", code: '{\n "url": "https://mcp.talonic.com/mcp",\n "headers": {\n "Authorization": "Bearer tlnc_your_key_here"\n }\n}' },
|
|
18482
|
+
{ type: "paragraph", text: "No environment variables needed. The API key is passed via the `Authorization` header on every request." }
|
|
18483
|
+
],
|
|
18484
|
+
related: [
|
|
18485
|
+
{ label: "Installation", slug: "mcp-installation" },
|
|
18486
|
+
{ label: "Authentication", slug: "mcp-authentication" }
|
|
18487
|
+
],
|
|
18488
|
+
faq: [],
|
|
18489
|
+
mentions: ["TALONIC_API_KEY", "TALONIC_BASE_URL", "configuration", "headers"]
|
|
18490
|
+
},
|
|
18491
|
+
{
|
|
18492
|
+
slug: "mcp-troubleshooting",
|
|
18493
|
+
parentSlug: "mcp-advanced",
|
|
18494
|
+
title: "Troubleshooting",
|
|
18495
|
+
seoTitle: "MCP Server Troubleshooting \u2014 Talonic Docs",
|
|
18496
|
+
description: "Common issues and fixes for the Talonic MCP server: missing API key, invisible server, 500 errors, and filter problems.",
|
|
18497
|
+
content: [
|
|
18498
|
+
{ type: "heading", level: 3, id: "ts-api-key", text: "TALONIC_API_KEY environment variable is required" },
|
|
18499
|
+
{ type: "paragraph", text: "The `env` block in your MCP client config is missing or not being read. Double-check the JSON shape. After editing, fully restart the client (not just the conversation)." },
|
|
18500
|
+
{ type: "heading", level: 3, id: "ts-hosted-401", text: "Hosted server returns 401 Unauthorized" },
|
|
18501
|
+
{ type: "paragraph", text: 'The `Authorization` header is missing or malformed. Ensure the config has `"headers": { "Authorization": "Bearer tlnc_..." }`. The key must start with `tlnc_`.' },
|
|
18502
|
+
{ type: "heading", level: 3, id: "ts-not-visible", text: "Talonic does not appear in connected servers" },
|
|
18503
|
+
{ type: "paragraph", text: 'For local: make sure the `command` is `npx` and `args` are exactly `["-y", "@talonic/mcp@latest"]`. Sanity check: run `npx -y @talonic/mcp@latest --version` in a terminal. For hosted: ensure the `url` is `https://mcp.talonic.com/mcp` (note the `/mcp` path).' },
|
|
18504
|
+
{ type: "heading", level: 3, id: "ts-500", text: "talonic_extract returns 500 with auto-discovery" },
|
|
18505
|
+
{ type: "paragraph", text: "Always provide either an inline `schema` or a `schema_id`. The auto-discovery code path is not yet stable." },
|
|
18506
|
+
{ type: "heading", level: 3, id: "ts-unsupported", text: "unsupported_file_type error" },
|
|
18507
|
+
{ type: "paragraph", text: "The MIME type was inferred as `application/octet-stream`. Ensure the filename has a recognized extension (pdf, docx, png, jpg, etc.)." },
|
|
18508
|
+
{ type: "heading", level: 3, id: "ts-filter-validation", text: "talonic_filter: No field matches name" },
|
|
18509
|
+
{ type: "paragraph", text: "Field names must be canonical names from the field registry (e.g. `vendor.name`). Call `talonic_search` first; canonical names appear in `fields[].canonicalName`." },
|
|
18510
|
+
{ type: "heading", level: 3, id: "ts-402", text: "402 Payment Required / insufficient credits" },
|
|
18511
|
+
{ type: "paragraph", text: "Extraction credit balance is exhausted. Free tier: 50 extractions/day, resets at midnight UTC. Upgrade plan or wait for reset." },
|
|
18512
|
+
{ type: "heading", level: 3, id: "ts-cached", text: "Tool descriptions look wrong" },
|
|
18513
|
+
{ type: "paragraph", text: "Some MCP clients cache tool descriptions. Restart the client after a server update." },
|
|
18514
|
+
{ type: "heading", level: 3, id: "ts-session-lost", text: "Hosted server: session_not_found (404)" },
|
|
18515
|
+
{ type: "paragraph", text: "Sessions are in-memory on the hosted server. After a deploy or restart, existing sessions are lost. The client should re-initialize without the `Mcp-Session-Id` header \u2014 most MCP clients handle this automatically." }
|
|
18516
|
+
],
|
|
18517
|
+
related: [
|
|
18518
|
+
{ label: "Installation", slug: "mcp-installation" },
|
|
18519
|
+
{ label: "Configuration", slug: "mcp-configuration" },
|
|
18520
|
+
{ label: "Cost & Rate Limits", slug: "mcp-cost-and-limits" }
|
|
18521
|
+
],
|
|
18522
|
+
faq: [],
|
|
18523
|
+
mentions: ["troubleshooting", "debugging", "errors", "401", "402", "500"]
|
|
18524
|
+
}
|
|
18525
|
+
];
|
|
18526
|
+
|
|
18527
|
+
// src/content/mcp/index.ts
|
|
18528
|
+
var sections46 = sections_default2;
|
|
18529
|
+
|
|
17448
18530
|
// src/content/index.ts
|
|
17449
18531
|
var ALL_PLATFORM_RAW = [
|
|
17450
18532
|
...sections,
|
|
@@ -17494,6 +18576,8 @@ var ALL_API_RAW = [
|
|
|
17494
18576
|
...sections43,
|
|
17495
18577
|
...sections44
|
|
17496
18578
|
];
|
|
18579
|
+
var ALL_SDK_RAW = [...sections45];
|
|
18580
|
+
var ALL_MCP_RAW = [...sections46];
|
|
17497
18581
|
function enrich(raw, navSections, domain) {
|
|
17498
18582
|
return raw.map((r) => {
|
|
17499
18583
|
const { prev, next } = derivePrevNext(navSections, r.slug);
|
|
@@ -17519,6 +18603,20 @@ function getApiSectionsAll() {
|
|
|
17519
18603
|
}
|
|
17520
18604
|
return _apiSections;
|
|
17521
18605
|
}
|
|
18606
|
+
var _sdkSections = null;
|
|
18607
|
+
var _mcpSections = null;
|
|
18608
|
+
function getSdkSectionsAll() {
|
|
18609
|
+
if (!_sdkSections) {
|
|
18610
|
+
_sdkSections = enrich(ALL_SDK_RAW, SDK_NAV_SECTIONS, "sdk");
|
|
18611
|
+
}
|
|
18612
|
+
return _sdkSections;
|
|
18613
|
+
}
|
|
18614
|
+
function getMcpSectionsAll() {
|
|
18615
|
+
if (!_mcpSections) {
|
|
18616
|
+
_mcpSections = enrich(ALL_MCP_RAW, MCP_NAV_SECTIONS, "mcp");
|
|
18617
|
+
}
|
|
18618
|
+
return _mcpSections;
|
|
18619
|
+
}
|
|
17522
18620
|
function getPlatformSection(slug) {
|
|
17523
18621
|
return getPlatformSectionsAll().find((s) => s.slug === slug) ?? null;
|
|
17524
18622
|
}
|
|
@@ -17531,9 +18629,25 @@ function getApiSection(slug) {
|
|
|
17531
18629
|
function getAllApiSections() {
|
|
17532
18630
|
return getApiSectionsAll();
|
|
17533
18631
|
}
|
|
18632
|
+
function getSdkSection(slug) {
|
|
18633
|
+
return getSdkSectionsAll().find((s) => s.slug === slug) ?? null;
|
|
18634
|
+
}
|
|
18635
|
+
function getAllSdkSections() {
|
|
18636
|
+
return getSdkSectionsAll();
|
|
18637
|
+
}
|
|
18638
|
+
function getMcpSection(slug) {
|
|
18639
|
+
return getMcpSectionsAll().find((s) => s.slug === slug) ?? null;
|
|
18640
|
+
}
|
|
18641
|
+
function getAllMcpSections() {
|
|
18642
|
+
return getMcpSectionsAll();
|
|
18643
|
+
}
|
|
17534
18644
|
export {
|
|
17535
18645
|
getAllApiSections,
|
|
18646
|
+
getAllMcpSections,
|
|
17536
18647
|
getAllPlatformSections,
|
|
18648
|
+
getAllSdkSections,
|
|
17537
18649
|
getApiSection,
|
|
17538
|
-
|
|
18650
|
+
getMcpSection,
|
|
18651
|
+
getPlatformSection,
|
|
18652
|
+
getSdkSection
|
|
17539
18653
|
};
|