@talonic/mcp 0.1.11 → 0.1.13

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/README.md CHANGED
@@ -105,15 +105,49 @@ Open Cowork settings → MCP Servers → Add. Use the same shape as Claude Deskt
105
105
 
106
106
  Each tool's description is written for an LLM, with explicit USE WHEN / DO NOT USE WHEN sections. Agents pick the right tool reliably without further prompting. Briefly:
107
107
 
108
- - **`talonic_extract`** — Extract structured, schema-validated data from a document. Inputs: one of `file_data` + `filename` (recommended for chat clients, see below), `file_path`, `file_url`, or `document_id`, plus a `schema` (or `schema_id`). Returns clean JSON with per-field confidence scores.
109
- - **`talonic_search`** — Omnisearch across documents, fields, sources, and schemas in the workspace. Use for conceptual or fuzzy queries.
110
- - **`talonic_filter`** — Filter documents by extracted field values using composable conditions (`eq`, `gt`, `between`, `contains`, etc.). Accepts canonical field names (e.g. `vendor.name`, `policy.0_coverage_type`) which the Talonic API resolves to ids server-side, or UUIDs directly. The `is_not_empty` operator currently underreports; see [Known limitations](#known-limitations-v01).
111
- - **`talonic_get_document`** — Fetch full metadata for a single document by id, including processing log and link URLs.
112
- - **`talonic_to_markdown`** — Get OCR-converted markdown for a document. Accepts `document_id` (cheapest), `file_data` + `filename`, `file_path`, or `file_url`.
113
- - **`talonic_list_schemas`** — List all saved schemas with their definitions.
114
- - **`talonic_save_schema`** — Save a schema definition to the workspace for reuse.
115
-
116
- The `talonic://schemas` resource exposes the saved-schemas list to clients that browse resources separately (Claude Desktop and Cowork render these in the UI).
108
+ - **`talonic_extract`**, status: stable. Extract structured, schema-validated data from a document. Inputs: one of `file_data` + `filename` (recommended for chat clients, see below), `file_path`, `file_url`, or `document_id`, plus a `schema` or `schema_id`. Returns JSON with `data`, per-field `confidence`, and document metadata. Schema is required; the MCP layer rejects schema-less calls.
109
+ - **`talonic_search`**, status: stable. Omnisearch across documents, fields, sources, and schemas in the workspace. Use for conceptual or fuzzy queries.
110
+ - **`talonic_filter`**, status: stable. Filter documents by extracted field values using composable conditions (`eq`, `gt`, `between`, `contains`, `is_empty`, etc.). Accepts canonical field names (e.g. `vendor.name`) which the Talonic API resolves to ids server-side, or UUIDs directly. `is_not_empty` is intentionally not exposed in v0.1; see [Known limitations](#known-limitations-v01).
111
+ - **`talonic_get_document`**, status: stable. Fetch full metadata for a single document by id, including processing log and link URLs.
112
+ - **`talonic_to_markdown`**, status: stable. Get OCR-converted markdown for a document. Accepts `document_id` (cheapest), `file_data` + `filename`, `file_path`, or `file_url`.
113
+ - **`talonic_list_schemas`**, status: stable. List all saved schemas with their definitions. Returns both UUID and SCH-XXXXXXXX short id; either is accepted by `talonic_extract`.
114
+ - **`talonic_save_schema`**, status: stable. Save a schema definition to the workspace for reuse.
115
+
116
+ Two resources are also exposed for clients that browse them separately (Claude Desktop and Cowork render these in the UI):
117
+ - `talonic://schemas`: saved-schemas list.
118
+ - `talonic://webhooks/reference`: webhook event types, delivery behavior, signature verification algorithms, and retry policies. Use this when an agent needs to set up or troubleshoot a webhook integration without leaving the MCP context.
119
+
120
+ ## Agent decision guide
121
+
122
+ Pick the right tool before you call. The wrong tool returns the wrong data, costs unnecessary credits, and slows the conversation.
123
+
124
+ **User has a file (or just dropped one in)**
125
+ - They want specific fields (vendor, total, dates, parties): `talonic_extract` with `schema` or `schema_id`.
126
+ - They want full text content for summarisation, translation, or analysis: `talonic_to_markdown`.
127
+ - They want both: `talonic_extract` with `include_markdown: true`, one upload.
128
+
129
+ **User is asking about existing documents**
130
+ - Conceptual or fuzzy ("any docs about indemnification"): `talonic_search`.
131
+ - Value-based on extracted fields ("invoices over 1000 EUR"): `talonic_filter`.
132
+ - They reference a `document_id`: `talonic_get_document` for metadata, `talonic_to_markdown` for text, `talonic_extract` to re-extract with a new schema. Re-using a `document_id` is cheaper than re-uploading.
133
+
134
+ **User is working with schemas**
135
+ - One-off extraction: pass schema inline.
136
+ - Same schema across many documents: `talonic_save_schema` once, then `talonic_extract` with `schema_id`.
137
+ - Discover existing schemas first: `talonic_list_schemas`.
138
+ - Iterate inline before saving. Avoid clutter.
139
+
140
+ **Confidence and human review**
141
+ - `confidence.overall` below ~0.7: tell the user the extraction may be unreliable, surface low-confidence fields, confirm before any downstream action.
142
+ - Per-field confidence below ~0.7: mark as "needs review", do not use silently in calculations or external API calls.
143
+ - Critical fields (amounts, legal terms, names, dates): confirm with user before acting, even at high confidence.
144
+ - Per-field provenance (page, bbox) is not surfaced in v0.1. Send users to `links.dashboard` to verify against the source.
145
+
146
+ **When not to call Talonic**
147
+ - General-knowledge or chat questions. Do not pre-emptively extract.
148
+ - The data is already in conversation history from a previous tool call. Re-use it.
149
+ - The user wants to discuss or revise an extraction you already produced. Reason over the previous result instead of re-extracting.
150
+ - Cost, EUR price, and remaining balance are not surfaced in v0.1 tool responses. If the user asks about cost or credit balance, point them to https://app.talonic.com.
117
151
 
118
152
  ## Drag-and-drop in chat clients
119
153
 
package/dist/content.js CHANGED
@@ -152,6 +152,118 @@ var sections = [
152
152
  ],
153
153
  mentions: ["OCR", "schema-validated", "confidence scores", "structured data"]
154
154
  },
155
+ {
156
+ slug: "agent-decision-guide",
157
+ parentSlug: "overview",
158
+ title: "Agent Decision Guide",
159
+ seoTitle: "Agent Decision Guide \u2014 Talonic MCP",
160
+ description: "How an AI agent should pick between Talonic's tools, handle low-confidence results, and avoid unnecessary calls.",
161
+ content: [
162
+ {
163
+ type: "paragraph",
164
+ text: "Use this guide to pick the right Talonic tool for the user's request. Match the user's intent to one of the scenarios below before calling a tool. The wrong tool returns the wrong data, costs unnecessary credits, and slows the conversation."
165
+ },
166
+ {
167
+ type: "heading",
168
+ level: 3,
169
+ id: "decide-extract-vs-markdown",
170
+ text: "User has a file (or just dropped one in)"
171
+ },
172
+ {
173
+ type: "list",
174
+ items: [
175
+ "**They want specific fields**: vendor, total, dates, parties, line items. Use `talonic_extract` with a `schema` (full JSON Schema is most reliable) or a `schema_id` from `talonic_list_schemas`. Schema is required; the MCP layer rejects schema-less calls.",
176
+ "**They want the full text content**, e.g. for summarisation, translation, or general analysis. Use `talonic_to_markdown`. It returns OCR-converted markdown without forcing a schema.",
177
+ "**They want both**: extract once with a schema (which also yields markdown when `include_markdown: true` is set), avoiding two uploads."
178
+ ]
179
+ },
180
+ {
181
+ type: "heading",
182
+ level: 3,
183
+ id: "decide-find-existing",
184
+ text: "User is asking about existing documents in the workspace"
185
+ },
186
+ {
187
+ type: "list",
188
+ items: [
189
+ "**Conceptual or fuzzy** (e.g. 'do I have any docs about indemnification?', 'find Acme contracts'): use `talonic_search`.",
190
+ "**Value-based on extracted fields** (e.g. 'invoices over 1000 EUR', 'contracts expiring before 2026-12-31'): use `talonic_filter`. `is_not_empty` is not exposed in v0.1; for presence checks against populated fields, filter against a known value or use `is_empty` and invert client-side.",
191
+ "**They reference a specific document_id**: use `talonic_get_document` for metadata, `talonic_to_markdown` (with `document_id`) for text, or `talonic_extract` (with `document_id`) to re-extract with a new schema. Re-using a document_id is cheaper than re-uploading."
192
+ ]
193
+ },
194
+ {
195
+ type: "heading",
196
+ level: 3,
197
+ id: "decide-schema-mgmt",
198
+ text: "User is working with schemas"
199
+ },
200
+ {
201
+ type: "list",
202
+ items: [
203
+ "**One-off extraction**: pass the schema inline on `talonic_extract`. Do not save it.",
204
+ "**The same schema across many documents**: call `talonic_save_schema` once, then pass the returned id (UUID or `SCH-XXXXXXXX`) as `schema_id` on every future `talonic_extract` call. Either id form is accepted.",
205
+ "**Discovering existing schemas** before designing a new one: call `talonic_list_schemas`. The `talonic://schemas` resource is the same list rendered as a browseable resource for clients that support it.",
206
+ "**Avoid clutter**: do not save a schema until the user has reviewed and confirmed the design. Iterate inline first."
207
+ ]
208
+ },
209
+ {
210
+ type: "heading",
211
+ level: 3,
212
+ id: "decide-confidence",
213
+ text: "Handling confidence and human review"
214
+ },
215
+ {
216
+ type: "paragraph",
217
+ text: "Every `talonic_extract` response includes `confidence.overall` (0..1) and `confidence.fields` (per-field 0..1). Use these to decide when to escalate."
218
+ },
219
+ {
220
+ type: "list",
221
+ items: [
222
+ "**`confidence.overall` below ~0.7**: tell the user the extraction may be unreliable, show the top low-confidence fields, and ask them to confirm before taking any downstream action (payment, contract execution, data import).",
223
+ "**Per-field confidence below ~0.7**: surface those fields with a 'needs review' marker. Do not silently use them in calculations or external API calls.",
224
+ "**Critical fields at any confidence**: financial amounts, legal terms, names, dates. Always confirm with the user before acting on them, even at high confidence.",
225
+ "**Provenance is not surfaced in v0.1.** Per-field source page or bounding box is not in the response. If the user needs to verify a specific field against the source, send them to the document via `links.dashboard` from the response."
226
+ ]
227
+ },
228
+ {
229
+ type: "heading",
230
+ level: 3,
231
+ id: "decide-not-call",
232
+ text: "When not to call Talonic"
233
+ },
234
+ {
235
+ type: "list",
236
+ items: [
237
+ "**The user's question is general knowledge or conversation.** Do not pre-emptively extract or search.",
238
+ "**The needed data is already in conversation history** from a previous tool call. Re-use it. Repeat calls cost credits and slow the response.",
239
+ "**The user wants to discuss or revise** an extraction you already produced. Reason over the previous result instead of re-extracting.",
240
+ "**Schema design iteration**. Iterate the schema with the user via `talonic_extract` with an inline schema; only call `talonic_save_schema` once they confirm.",
241
+ "**Cost, EUR price, and remaining credit balance are not surfaced in v0.1 tool responses.** If the user asks 'how much will this cost' or 'how many credits do I have left', point them to the Talonic dashboard at https://app.talonic.com."
242
+ ]
243
+ }
244
+ ],
245
+ related: [
246
+ { label: "talonic_extract", slug: "talonic-extract" },
247
+ { label: "talonic_filter", slug: "talonic-filter" },
248
+ { label: "talonic_search", slug: "talonic-search" },
249
+ { label: "Known Limitations", slug: "known-limitations" }
250
+ ],
251
+ faq: [
252
+ {
253
+ question: "When should an agent use talonic_extract vs talonic_to_markdown?",
254
+ answer: "Use talonic_extract when the user wants specific structured fields (with a schema). Use talonic_to_markdown when the user wants the full text content for summarisation or analysis without a schema."
255
+ },
256
+ {
257
+ question: "When should an agent use talonic_search vs talonic_filter?",
258
+ answer: "Use talonic_search for conceptual or fuzzy queries across the workspace. Use talonic_filter when the user wants documents matching specific structured field values like 'invoices over 1000 EUR'."
259
+ },
260
+ {
261
+ question: "How should an agent handle low-confidence extractions?",
262
+ answer: "Treat confidence below ~0.7 as needing human review. Surface low-confidence fields explicitly and confirm critical fields (amounts, dates, names) with the user before any downstream action."
263
+ }
264
+ ],
265
+ mentions: ["decision guide", "agent", "tool selection", "confidence", "human review", "cost"]
266
+ },
155
267
  {
156
268
  slug: "get-api-key",
157
269
  parentSlug: "overview",
@@ -521,28 +633,42 @@ var sections3 = [
521
633
  language: "json",
522
634
  title: "Tool response",
523
635
  code: `{
524
- "document_id": "doc_8f3a...",
636
+ "extraction_id": "ext_8f3a...",
637
+ "request_id": "req_2c91...",
638
+ "status": "complete",
639
+ "document": {
640
+ "id": "doc_8f3a...",
641
+ "filename": "invoice-2026-001.pdf",
642
+ "pages": 2,
643
+ "type_detected": "invoice",
644
+ "language_detected": "de"
645
+ },
525
646
  "data": {
526
647
  "vendor_name": "Meridian Energy AG",
527
648
  "invoice_number": "INV-2026-001",
528
649
  "total_amount": 1500.00,
529
650
  "due_date": "2026-06-15",
530
651
  "line_items": [
531
- { "description": "Consulting \u2014 April", "amount": 1200.00 },
652
+ { "description": "Consulting, April", "amount": 1200.00 },
532
653
  { "description": "Travel expenses", "amount": 300.00 }
533
654
  ]
534
655
  },
656
+ "schema": {
657
+ "source": "inline"
658
+ },
535
659
  "confidence": {
536
- "vendor_name": 0.98,
537
- "invoice_number": 0.95,
538
- "total_amount": 0.99,
539
- "due_date": 0.97
660
+ "overall": 0.97,
661
+ "fields": {
662
+ "vendor_name": 0.98,
663
+ "invoice_number": 0.95,
664
+ "total_amount": 0.99,
665
+ "due_date": 0.97
666
+ }
540
667
  },
541
- "document": {
542
- "filename": "invoice-2026-001.pdf",
543
- "pages": 2,
544
- "type_detected": "Invoice",
545
- "language_detected": "de"
668
+ "processing": {
669
+ "duration_ms": 2840,
670
+ "pages_processed": 2,
671
+ "region": "eu-central-1"
546
672
  }
547
673
  }`
548
674
  },
@@ -554,6 +680,51 @@ var sections3 = [
554
680
  code: `{
555
681
  "file_path": "./contracts/lease-agreement.pdf",
556
682
  "schema_id": "SCH-A1B2C3D4"
683
+ }`
684
+ },
685
+ {
686
+ type: "code",
687
+ language: "json",
688
+ title: "Tool response",
689
+ code: `{
690
+ "extraction_id": "ext_b29f...",
691
+ "request_id": "req_4c81...",
692
+ "status": "complete",
693
+ "document": {
694
+ "id": "doc_91ad...",
695
+ "filename": "lease-agreement.pdf",
696
+ "pages": 8,
697
+ "type_detected": "lease_agreement",
698
+ "language_detected": "en"
699
+ },
700
+ "data": {
701
+ "lessor": "Acme Holdings Ltd.",
702
+ "lessee": "Meridian Energy AG",
703
+ "premises_address": "12 Hauptstrasse, 10115 Berlin",
704
+ "term_start": "2026-07-01",
705
+ "term_end": "2031-06-30",
706
+ "monthly_rent_eur": 4250.00
707
+ },
708
+ "schema": {
709
+ "source": "saved",
710
+ "id": "SCH-A1B2C3D4"
711
+ },
712
+ "confidence": {
713
+ "overall": 0.94,
714
+ "fields": {
715
+ "lessor": 0.97,
716
+ "lessee": 0.97,
717
+ "premises_address": 0.92,
718
+ "term_start": 0.95,
719
+ "term_end": 0.95,
720
+ "monthly_rent_eur": 0.91
721
+ }
722
+ },
723
+ "processing": {
724
+ "duration_ms": 4380,
725
+ "pages_processed": 8,
726
+ "region": "eu-central-1"
727
+ }
557
728
  }`
558
729
  }
559
730
  ],
@@ -686,7 +857,7 @@ var sections3 = [
686
857
  {
687
858
  type: "callout",
688
859
  variant: "warning",
689
- text: "The `is_not_empty` operator currently underreports. Use specific operators (`eq`, `gt`, `contains`, etc.) against known values when possible."
860
+ text: "`is_not_empty` is intentionally not exposed in v0.1 because it underreports against fields known to be populated. Workaround: filter with `eq`/`gt`/`contains` against a known value, or use `is_empty` and invert the result client-side."
690
861
  },
691
862
  { type: "heading", level: 3, id: "filter-example", text: "Example" },
692
863
  {
@@ -1189,12 +1360,12 @@ var sections6 = [
1189
1360
  {
1190
1361
  type: "heading",
1191
1362
  level: 3,
1192
- id: "extract-500",
1193
- text: "talonic_extract returns 500 with auto-discovery"
1363
+ id: "extract-no-schema",
1364
+ text: "talonic_extract returns a validation error when no schema is given"
1194
1365
  },
1195
1366
  {
1196
1367
  type: "paragraph",
1197
- text: "Known limitation. Always provide either an inline `schema` or a `schema_id`. The auto-discovery code path is being stabilised."
1368
+ text: "By design in v0.1. Schema-less extraction is unreliable, so the MCP layer rejects calls that omit both `schema` and `schema_id` before they reach the API. Provide either an inline `schema` (full JSON Schema recommended) or a `schema_id` from `talonic_list_schemas`."
1198
1369
  },
1199
1370
  {
1200
1371
  type: "heading",
@@ -1244,15 +1415,16 @@ var sections6 = [
1244
1415
  parentSlug: "troubleshooting",
1245
1416
  title: "Known Limitations",
1246
1417
  seoTitle: "Known Limitations \u2014 Talonic MCP",
1247
- description: "Current limitations in the Talonic MCP server v0.1: auto-discovery, schema format, filter operators, and schema_id format.",
1418
+ description: "Current limitations in the Talonic MCP server v0.1: schema requirement, filter operators, cost surfacing, and provenance.",
1248
1419
  content: [
1249
1420
  {
1250
1421
  type: "list",
1251
1422
  items: [
1252
- "**Auto-discovery extract (no schema) is not reliable on production.** Always pass a `schema` or `schema_id` to `talonic_extract`.",
1253
- "**Schema definition: prefer full JSON Schema for now.** The flat key-type map is documented as supported but the server-side normaliser does not translate it yet.",
1254
- "**`is_not_empty` filter currently underreports.** Use specific operators (`eq`, `gt`, `contains`, etc.) against known values instead.",
1255
- "**`schema_id` on `talonic_extract` requires the UUID form.** Other endpoints accept either UUID or `SCH-XXXXXXXX`, but `/v1/extract` currently only accepts UUIDs. Pass the UUID from `talonic_list_schemas`."
1423
+ "**Schema is required on `talonic_extract`.** Schema-less extraction is unreliable in v0.1 and is rejected at the MCP layer with a validation error. Always pass a `schema` (full JSON Schema recommended) or a `schema_id`.",
1424
+ "**Schema definition: prefer full JSON Schema.** The flat key-type map is documented as accepted; if you get a 'no fields' error from the API, fall back to JSON Schema.",
1425
+ "**`is_not_empty` filter is not exposed in v0.1.** It underreports against fields known to be populated. Workaround: filter with `eq`/`gt`/`contains` against a known value, or use `is_empty` and invert the result client-side.",
1426
+ "**Cost, EUR price, and remaining balance are not surfaced.** The API does not return them yet. Tool responses include rate-limit info via the SDK's `WithRateLimit<T>` wrapper, but credit balance must be checked in the Talonic dashboard.",
1427
+ "**Per-field source provenance (page, bounding box) is not surfaced.** Confidence scores per field are returned in `confidence.fields`. Treat fields below ~0.7 as needing human review."
1256
1428
  ]
1257
1429
  }
1258
1430
  ],
@@ -1263,10 +1435,10 @@ var sections6 = [
1263
1435
  faq: [
1264
1436
  {
1265
1437
  question: "What are the known limitations of Talonic MCP?",
1266
- answer: "Auto-discovery extract without a schema is unreliable, flat key-type schema maps are not yet translated, is_not_empty filter underreports, and schema_id on extract requires UUID format."
1438
+ answer: "Schema is required on talonic_extract (schema-less mode is disabled at the MCP layer). Flat key-type schema maps may need a JSON Schema fallback. is_not_empty filter is not exposed in v0.1. Cost and per-field provenance are not surfaced in tool responses yet."
1267
1439
  }
1268
1440
  ],
1269
- mentions: ["limitations", "auto-discovery", "is_not_empty", "schema_id"]
1441
+ mentions: ["limitations", "schema", "is_not_empty", "confidence", "rate limits"]
1270
1442
  },
1271
1443
  {
1272
1444
  slug: "upgrading",