@talonic/mcp 0.1.65 → 0.1.66
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/http-server.js +27 -10
- package/dist/http-server.js.map +1 -1
- package/dist/index.js +27 -10
- package/dist/index.js.map +1 -1
- package/dist/server.js +27 -10
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/http-server.js
CHANGED
|
@@ -890,6 +890,7 @@ var DESCRIPTION2 = [
|
|
|
890
890
|
"USE WHEN: value-based criteria on extracted fields \u2014 numeric/date/text comparisons or presence checks.",
|
|
891
891
|
"NOT FOR: free-text / concept search (use talonic_search) \xB7 a single document by id (use talonic_get_document).",
|
|
892
892
|
"ARGS: conditions[] (AND-ed). Each = EXACTLY ONE of `field` (canonical name) or `field_id` (UUID), an `operator`, and usually a `value`. Operators: eq, neq, gt, gte, lt, lte, between (needs `value` AND `value_to`), contains, is_empty / is_not_empty (no value). `value`/`value_to` are string|number|boolean matching the field type (ISO YYYY-MM-DD for dates).",
|
|
893
|
+
"TEXT FILTERS: for eq/contains/is_not_empty on a text field, just TRY a natural field name ('currency', 'vendor_name') \u2014 names resolve server-side and an unresolved field surfaces in warnings[] rather than erroring. Do NOT block on discovering the field first; search-first is only required for numeric operators.",
|
|
893
894
|
"NUMERIC GUARD: gt/gte/lt/lte/between only work when the field's dataType is 'number'. Call talonic_search first and check dataType; a numeric op on a string field returns zero matches. If the response has `warnings[]`, surface them to the user \u2014 do not silently retry.",
|
|
894
895
|
"RETURNS: data[] (matching documents with field values), total, warnings[]."
|
|
895
896
|
].join("\n");
|
|
@@ -1071,7 +1072,7 @@ var DESCRIPTION4 = [
|
|
|
1071
1072
|
"NOT FOR: full text (use talonic_to_markdown) \xB7 extracted fields (use talonic_extract).",
|
|
1072
1073
|
"BY NAME: if the user names a file, call talonic_search first to get its document_id, then call this.",
|
|
1073
1074
|
"ARGS: document_id.",
|
|
1074
|
-
"RETURNS: filename, pages, type_detected, language, and `status`. Status lifecycle: pending_upload -> queued -> extracting -> completed. Wait for `completed` before calling talonic_extract on a freshly uploaded doc."
|
|
1075
|
+
"RETURNS: filename, pages, type_detected, language, and `status`. Status lifecycle: pending_upload -> queued -> extracting -> completed. Wait for `completed` before calling talonic_extract on a freshly uploaded doc. To read the document's text, call talonic_to_markdown with this id."
|
|
1075
1076
|
].join("\n");
|
|
1076
1077
|
var inputSchema4 = {
|
|
1077
1078
|
document_id: z.string().min(1).describe(
|
|
@@ -1299,16 +1300,17 @@ function registerSaveSchema(server, getTalonic) {
|
|
|
1299
1300
|
);
|
|
1300
1301
|
}
|
|
1301
1302
|
var DESCRIPTION7 = [
|
|
1302
|
-
"Find documents, fields, schemas, or sources in the workspace
|
|
1303
|
+
"Find documents, fields, schemas, or sources in the workspace. One call returns ranked results across all types.",
|
|
1303
1304
|
"",
|
|
1304
|
-
"
|
|
1305
|
+
"MATCHING IS LITERAL KEYWORD, not semantic. Query with ONE short SINGULAR term or an exact filename: 'invoice', 'bank statement', 'sample-invoice.pdf'. Sentences ('documents related to invoices') and plurals ('invoices') return empty. If a search comes back empty, retry with a shorter singular keyword before concluding the workspace has nothing.",
|
|
1306
|
+
"USE WHEN: the user names or describes a document without an id, or you need a document_id or a filterable field name before extract / to_markdown / get_document / filter.",
|
|
1305
1307
|
"NOT FOR: structured field-value filters like 'amount > 1000' (use talonic_filter).",
|
|
1306
|
-
"ARGS: query (
|
|
1308
|
+
"ARGS: query (short literal keyword); optional limit.",
|
|
1307
1309
|
"RETURNS: documents[], fields[]/fieldMatches[] (only `filterable: true` entries work in talonic_filter), schemas[], sources[]. Use the id from documents[] to act on a named file."
|
|
1308
1310
|
].join("\n");
|
|
1309
1311
|
var inputSchema6 = {
|
|
1310
1312
|
query: z.string().min(1).describe(
|
|
1311
|
-
"
|
|
1313
|
+
"ONE short, SINGULAR keyword or an exact filename \u2014 'invoice', 'insurance certificate', 'sample-invoice.pdf'. Matching is literal: sentences and plurals return empty."
|
|
1312
1314
|
),
|
|
1313
1315
|
limit: z.number().int().positive().optional().describe("Maximum results per entity type. Default: 5. Increase for broader exploration.")
|
|
1314
1316
|
};
|
|
@@ -1352,6 +1354,9 @@ var outputSchema7 = {
|
|
|
1352
1354
|
})
|
|
1353
1355
|
).describe(
|
|
1354
1356
|
"Field-registry entries matching the query. filterable: true entries are usable with talonic_filter."
|
|
1357
|
+
),
|
|
1358
|
+
hint: z.string().optional().describe(
|
|
1359
|
+
"Present only when nothing matched: actionable guidance to retry with a shorter singular keyword."
|
|
1355
1360
|
)
|
|
1356
1361
|
};
|
|
1357
1362
|
async function handleSearch(talonic, args) {
|
|
@@ -1360,6 +1365,14 @@ async function handleSearch(talonic, args) {
|
|
|
1360
1365
|
args.query,
|
|
1361
1366
|
args.limit !== void 0 ? { limit: args.limit } : {}
|
|
1362
1367
|
);
|
|
1368
|
+
const r = result;
|
|
1369
|
+
const empty = (r["documents"]?.length ?? 0) === 0 && (r["fieldMatches"]?.length ?? 0) === 0 && (r["sources"]?.length ?? 0) === 0 && (r["schemas"]?.length ?? 0) === 0 && (r["fields"]?.length ?? 0) === 0;
|
|
1370
|
+
if (empty) {
|
|
1371
|
+
return jsonOk({
|
|
1372
|
+
...result,
|
|
1373
|
+
hint: "No matches. Matching is literal keyword search \u2014 retry with ONE short, SINGULAR term or an exact filename (e.g. 'invoice', not 'invoices' or a sentence) before concluding nothing exists."
|
|
1374
|
+
});
|
|
1375
|
+
}
|
|
1363
1376
|
return jsonOk(result);
|
|
1364
1377
|
} catch (err) {
|
|
1365
1378
|
return toolError(err);
|
|
@@ -1565,7 +1578,7 @@ function registerToMarkdown(server, getTalonic) {
|
|
|
1565
1578
|
|
|
1566
1579
|
// package.json
|
|
1567
1580
|
var package_default = {
|
|
1568
|
-
version: "0.1.
|
|
1581
|
+
version: "0.1.66"};
|
|
1569
1582
|
|
|
1570
1583
|
// src/version.ts
|
|
1571
1584
|
var VERSION = package_default.version;
|
|
@@ -1624,12 +1637,16 @@ function createServer(options) {
|
|
|
1624
1637
|
"Talonic turns any document (PDF, scan, image, DOCX, contract, invoice, form,",
|
|
1625
1638
|
"certificate, statement) into clean, schema-validated JSON, and answers questions",
|
|
1626
1639
|
"about the user's document workspace.",
|
|
1627
|
-
"
|
|
1628
|
-
"
|
|
1629
|
-
"
|
|
1640
|
+
"ALL NINE talonic_* tools are registered and callable on EVERY turn of this",
|
|
1641
|
+
"session. If you believe one is missing from your toolset, you are mistaken \u2014",
|
|
1642
|
+
"invoke it anyway. Never tell the user a Talonic tool is unavailable or not in",
|
|
1643
|
+
"your toolset, and never ask them to 'enable' anything.",
|
|
1630
1644
|
"If the user refers to a document by name (e.g. 'invoice.pdf'), first call",
|
|
1631
1645
|
"talonic_search to resolve the name to a document_id, then call the tool you need",
|
|
1632
|
-
"with that id \u2014 do not ask the user for an id.
|
|
1646
|
+
"with that id \u2014 do not ask the user for an id.",
|
|
1647
|
+
"talonic_search matches LITERAL keywords: query with one short singular term or an",
|
|
1648
|
+
"exact filename, never a sentence; on an empty result retry with a shorter keyword.",
|
|
1649
|
+
"Prefer acting over explaining."
|
|
1633
1650
|
].join(" ")
|
|
1634
1651
|
}
|
|
1635
1652
|
);
|