@talonic/mcp 0.1.96 → 0.1.98

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/index.js CHANGED
@@ -441,15 +441,30 @@ var WIDGET_DESCRIPTIONS = {
441
441
  releaseDecisionTask: "Confirmation that the decision task was released back to available for another claimant.",
442
442
  failDecisionTask: "Confirmation that the task was reported undecidable: a Human Review is raised and the app's fallback applies."
443
443
  };
444
+ var CARD_TOOL_KEYS = /* @__PURE__ */ new Set([
445
+ "extract",
446
+ "ask",
447
+ "getAnswer",
448
+ "getRunResults",
449
+ "requestUpload",
450
+ "getBalance",
451
+ "getUsage",
452
+ "getPricing",
453
+ "saveSchema",
454
+ "createAccount"
455
+ ]);
444
456
  function widgetToolMeta(key) {
445
457
  const uri = WIDGET_URIS[key];
446
458
  const status3 = TOOL_INVOCATION_STATUS[key];
447
- return {
448
- ui: { resourceUri: uri },
449
- "openai/outputTemplate": uri,
459
+ const meta = {
450
460
  "openai/toolInvocation/invoking": status3.invoking,
451
461
  "openai/toolInvocation/invoked": status3.invoked
452
462
  };
463
+ if (CARD_TOOL_KEYS.has(key)) {
464
+ meta["ui"] = { resourceUri: uri };
465
+ meta["openai/outputTemplate"] = uri;
466
+ }
467
+ return meta;
453
468
  }
454
469
 
455
470
  // src/widgets/shared.ts
@@ -558,6 +573,33 @@ var BASE_CSS = `
558
573
  details.tree > summary { cursor: pointer; font-size: 13px; list-style: none; }
559
574
  details.tree > summary::before { content: "\u25B8 "; color: var(--muted); }
560
575
  details.tree[open] > summary::before { content: "\u25BE "; }
576
+ .loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px; color: var(--muted); }
577
+ .tl-mark { color: var(--accent); }
578
+ .tl-mark g, .tl-mark circle { transform-box: view-box; transform-origin: 0 0; }
579
+ .tl-layer { fill: none; stroke: currentColor; stroke-width: 20; stroke-linecap: round; }
580
+ .tl-spin { animation: tl-spin 4s infinite; }
581
+ .tl-core { animation: tl-core 4s infinite; }
582
+ .tl-arm { animation: tl-arm 4s infinite; animation-delay: calc(4s * var(--i) * -0.0075); }
583
+ @keyframes tl-spin {
584
+ 0% { transform: rotate(0deg); animation-timing-function: cubic-bezier(.55, 0, .9, .45); }
585
+ 42% { transform: rotate(560deg); animation-timing-function: linear; }
586
+ 58% { transform: rotate(860deg); animation-timing-function: cubic-bezier(.1, .6, .25, 1); }
587
+ 100% { transform: rotate(1080deg); }
588
+ }
589
+ @keyframes tl-arm {
590
+ 0%, 24% { transform: scale(1); animation-timing-function: cubic-bezier(.6, 0, .85, .3); }
591
+ 48% { transform: scale(.06); animation-timing-function: linear; }
592
+ 60% { transform: scale(.06); animation-timing-function: cubic-bezier(.2, 1.5, .35, 1); }
593
+ 84%, 100% { transform: scale(1); }
594
+ }
595
+ @keyframes tl-core {
596
+ 0%, 28% { transform: scale(1); animation-timing-function: cubic-bezier(.6, 0, .85, .3); }
597
+ 48% { transform: scale(.5); animation-timing-function: ease-in-out; }
598
+ 58% { transform: scale(.44); animation-timing-function: cubic-bezier(.2, 1.6, .4, 1); }
599
+ 74% { transform: scale(1.1); animation-timing-function: ease-in-out; }
600
+ 88%, 100% { transform: scale(1); }
601
+ }
602
+ @media (prefers-reduced-motion: reduce) { .tl-spin, .tl-core, .tl-arm { animation: none; } }
561
603
  `;
562
604
  var HELPERS_JS = `
563
605
  var root = document.getElementById("root");
@@ -806,7 +848,7 @@ ${opts.css ?? ""}
806
848
  </style>
807
849
  </head>
808
850
  <body>
809
- <div id="root" class="root"><div class="empty">Loading\u2026</div></div>
851
+ <div id="root" class="root"><div class="loading" role="status"><svg class="tl-mark" viewBox="-200 -200 400 400" width="36" height="36" aria-hidden="true" focusable="false"><g class="tl-layer"><g class="tl-spin"><circle class="tl-core" r="65.5" stroke-width="21"/><g transform="rotate(0)"><g class="tl-arm" style="--i:0"><path d="M-15 -66C-36 -90 -30 -118 4 -133"/><circle cy="-155" r="22"/></g></g><g transform="rotate(45)"><g class="tl-arm" style="--i:1"><path d="M-15 -66C-36 -90 -30 -118 4 -133"/><circle cy="-155" r="22"/></g></g><g transform="rotate(90)"><g class="tl-arm" style="--i:2"><path d="M-15 -66C-36 -90 -30 -118 4 -133"/><circle cy="-155" r="22"/></g></g><g transform="rotate(135)"><g class="tl-arm" style="--i:3"><path d="M-15 -66C-36 -90 -30 -118 4 -133"/><circle cy="-155" r="22"/></g></g><g transform="rotate(180)"><g class="tl-arm" style="--i:4"><path d="M-15 -66C-36 -90 -30 -118 4 -133"/><circle cy="-155" r="22"/></g></g><g transform="rotate(225)"><g class="tl-arm" style="--i:5"><path d="M-15 -66C-36 -90 -30 -118 4 -133"/><circle cy="-155" r="22"/></g></g><g transform="rotate(270)"><g class="tl-arm" style="--i:6"><path d="M-15 -66C-36 -90 -30 -118 4 -133"/><circle cy="-155" r="22"/></g></g><g transform="rotate(315)"><g class="tl-arm" style="--i:7"><path d="M-15 -66C-36 -90 -30 -118 4 -133"/><circle cy="-155" r="22"/></g></g></g></g></svg><span>Loading\u2026</span></div></div>
810
852
  <script>
811
853
  (function () {
812
854
  ${HELPERS_JS}
@@ -1847,9 +1889,9 @@ var RENDER_BODY27 = `
1847
1889
  var pg = payload.pagination && typeof payload.pagination === "object" ? payload.pagination : {};
1848
1890
  if (!rows.length) { empty("No result rows yet."); return; }
1849
1891
  function tone(s) { return s === "complete" || s === "completed" ? "good" : s === "error" ? "bad" : s === "partial" ? "warn" : "info"; }
1850
- var shownCols = cols.slice(0, 10);
1892
+ var shownCols = cols.slice(0, 6);
1851
1893
  var head = '<tr><th>Document</th><th>Status</th>' + shownCols.map(function (c) { return '<th>' + esc(c.display_name || c.field_key || "") + '</th>'; }).join("") + '</tr>';
1852
- var body = rows.slice(0, 50).map(function (r) {
1894
+ var body = rows.slice(0, 12).map(function (r) {
1853
1895
  r = r && typeof r === "object" ? r : {};
1854
1896
  var f = r.fields && typeof r.fields === "object" ? r.fields : {};
1855
1897
  return '<tr><td class="val">' + esc(r.filename || shortId(r.document_id)) + '</td><td>' + chip(r.status, tone(r.status)) + '</td>'
@@ -1858,10 +1900,10 @@ var RENDER_BODY27 = `
1858
1900
  var total = typeof pg.total === "number" ? pg.total : rows.length;
1859
1901
  var held = typeof payload.pending_review_count === "number" ? payload.pending_review_count : 0;
1860
1902
  var more = [];
1861
- if (rows.length > 50) more.push("+" + (rows.length - 50) + " more rows");
1862
- if (cols.length > 10) more.push("+" + (cols.length - 10) + " more columns");
1903
+ if (rows.length > 12) more.push("+" + (rows.length - 12) + " more rows");
1904
+ if (cols.length > 6) more.push("+" + (cols.length - 6) + " more columns");
1863
1905
  root.innerHTML = ''
1864
- + '<div class="header"><div><div class="title">Run results</div><div class="subtitle">' + Math.min(rows.length, 50) + ' of ' + total + ' rows' + (pg.has_more ? " \xB7 more available" : "") + '</div></div>'
1906
+ + '<div class="header"><div><div class="title">Run results</div><div class="subtitle">' + Math.min(rows.length, 12) + ' of ' + total + ' rows' + (pg.has_more ? " \xB7 more available" : "") + '</div></div>'
1865
1907
  + '<div>' + chip(payload.status, payload.status === "completed" ? "good" : payload.status === "failed" ? "bad" : "info") + (held ? chip(held + " held for review", "warn") : "") + '</div></div>'
1866
1908
  + '<table><thead>' + head + '</thead><tbody>' + body + '</tbody></table>'
1867
1909
  + (more.length ? '<div class="muted small" style="margin-top:6px">' + esc(more.join(" \xB7 ")) + '</div>' : "");
@@ -2430,12 +2472,12 @@ function registerExtract(server, getTalonic, opts = {}) {
2430
2472
  server.registerTool(
2431
2473
  "talonic_extract",
2432
2474
  {
2433
- title: "Extract Data from Document",
2475
+ title: "Extract data",
2434
2476
  description: DESCRIPTION,
2435
2477
  inputSchema: opts.localFiles ? inputSchema : hostedInputSchema,
2436
2478
  outputSchema,
2437
2479
  annotations: {
2438
- title: "Extract Data from Document",
2480
+ title: "Extract data",
2439
2481
  readOnlyHint: false,
2440
2482
  destructiveHint: false,
2441
2483
  openWorldHint: true
@@ -2559,12 +2601,12 @@ function registerFilter(server, getTalonic) {
2559
2601
  server.registerTool(
2560
2602
  "talonic_filter",
2561
2603
  {
2562
- title: "Filter Talonic Documents",
2604
+ title: "Filter documents",
2563
2605
  description: DESCRIPTION2,
2564
2606
  inputSchema: inputSchema2,
2565
2607
  outputSchema: outputSchema2,
2566
2608
  annotations: {
2567
- title: "Filter Talonic Documents",
2609
+ title: "Filter documents",
2568
2610
  readOnlyHint: true,
2569
2611
  destructiveHint: false,
2570
2612
  openWorldHint: false
@@ -2605,12 +2647,12 @@ function registerGetBalance(server, getTalonic) {
2605
2647
  server.registerTool(
2606
2648
  "talonic_get_balance",
2607
2649
  {
2608
- title: "Get Talonic Credit Balance",
2650
+ title: "Check credit balance",
2609
2651
  description: DESCRIPTION3,
2610
2652
  inputSchema: inputSchema3,
2611
2653
  outputSchema: outputSchema3,
2612
2654
  annotations: {
2613
- title: "Get Talonic Credit Balance",
2655
+ title: "Check credit balance",
2614
2656
  readOnlyHint: true,
2615
2657
  destructiveHint: false,
2616
2658
  openWorldHint: false
@@ -2657,12 +2699,12 @@ function registerGetPricing(server, getTalonic) {
2657
2699
  server.registerTool(
2658
2700
  "talonic_get_pricing",
2659
2701
  {
2660
- title: "Get Talonic Pricing",
2702
+ title: "Check pricing",
2661
2703
  description: DESCRIPTION4,
2662
2704
  inputSchema: inputSchema4,
2663
2705
  outputSchema: outputSchema4,
2664
2706
  annotations: {
2665
- title: "Get Talonic Pricing",
2707
+ title: "Check pricing",
2666
2708
  readOnlyHint: true,
2667
2709
  destructiveHint: false,
2668
2710
  openWorldHint: false
@@ -2706,12 +2748,12 @@ function registerGetUsage(server, getTalonic) {
2706
2748
  server.registerTool(
2707
2749
  "talonic_get_usage",
2708
2750
  {
2709
- title: "Get Talonic Usage",
2751
+ title: "Check credit usage",
2710
2752
  description: DESCRIPTION5,
2711
2753
  inputSchema: inputSchema5,
2712
2754
  outputSchema: outputSchema5,
2713
2755
  annotations: {
2714
- title: "Get Talonic Usage",
2756
+ title: "Check credit usage",
2715
2757
  readOnlyHint: true,
2716
2758
  destructiveHint: false,
2717
2759
  openWorldHint: false
@@ -2797,12 +2839,12 @@ function registerGetDocument(server, getTalonic) {
2797
2839
  server.registerTool(
2798
2840
  "talonic_get_document",
2799
2841
  {
2800
- title: "Get Talonic Document",
2842
+ title: "Look up a document",
2801
2843
  description: DESCRIPTION6,
2802
2844
  inputSchema: inputSchema6,
2803
2845
  outputSchema: outputSchema6,
2804
2846
  annotations: {
2805
- title: "Get Talonic Document",
2847
+ title: "Look up a document",
2806
2848
  readOnlyHint: true,
2807
2849
  destructiveHint: false,
2808
2850
  openWorldHint: false
@@ -2816,7 +2858,7 @@ var DESCRIPTION7 = [
2816
2858
  "List the saved schemas in the workspace as compact summaries (id, short_id, name, description, version, field_count).",
2817
2859
  "",
2818
2860
  "USE WHEN: 'what schemas do I have', or to find a reusable schema before extracting.",
2819
- "NOT FOR: a one-off extraction with an inline schema (call talonic_extract directly).",
2861
+ "NOT FOR: a one-off extraction with an inline schema (call talonic_extract directly). Not a warm-up before answering a question about the documents: call talonic_ask for that.",
2820
2862
  "ARGS: none.",
2821
2863
  "RETURNS: data[] of schema summaries. Field definitions are omitted here; call talonic_get_schema with an id to see a schema's fields. Pass a schema's id/short_id to talonic_extract as `schema_id`."
2822
2864
  ].join("\n");
@@ -2867,12 +2909,12 @@ function registerListSchemas(server, getTalonic) {
2867
2909
  server.registerTool(
2868
2910
  "talonic_list_schemas",
2869
2911
  {
2870
- title: "List Talonic Schemas",
2912
+ title: "List saved schemas",
2871
2913
  description: DESCRIPTION7,
2872
2914
  inputSchema: {},
2873
2915
  outputSchema: outputSchema7,
2874
2916
  annotations: {
2875
- title: "List Talonic Schemas",
2917
+ title: "List saved schemas",
2876
2918
  readOnlyHint: true,
2877
2919
  destructiveHint: false,
2878
2920
  openWorldHint: false
@@ -2902,13 +2944,13 @@ function registerGetSchema(server, getTalonic) {
2902
2944
  server.registerTool(
2903
2945
  "talonic_get_schema",
2904
2946
  {
2905
- title: "Get Talonic Schema",
2947
+ title: "Read a schema's fields",
2906
2948
  description: GET_DESCRIPTION,
2907
2949
  inputSchema: {
2908
2950
  schema_id: z.string().min(1).describe("Schema id (UUID) or short_id (SCH-XXXXXXXX) from talonic_list_schemas.")
2909
2951
  },
2910
2952
  annotations: {
2911
- title: "Get Talonic Schema",
2953
+ title: "Read a schema's fields",
2912
2954
  readOnlyHint: true,
2913
2955
  destructiveHint: false,
2914
2956
  idempotentHint: true,
@@ -2968,12 +3010,12 @@ function registerSaveSchema(server, getTalonic) {
2968
3010
  server.registerTool(
2969
3011
  "talonic_save_schema",
2970
3012
  {
2971
- title: "Save Talonic Schema",
3013
+ title: "Save a schema",
2972
3014
  description: DESCRIPTION8,
2973
3015
  inputSchema: inputSchema7,
2974
3016
  outputSchema: outputSchema8,
2975
3017
  annotations: {
2976
- title: "Save Talonic Schema",
3018
+ title: "Save a schema",
2977
3019
  readOnlyHint: false,
2978
3020
  destructiveHint: false,
2979
3021
  openWorldHint: false
@@ -3066,12 +3108,12 @@ function registerSearch(server, getTalonic) {
3066
3108
  server.registerTool(
3067
3109
  "talonic_search",
3068
3110
  {
3069
- title: "Search Talonic Workspace",
3111
+ title: "Search documents",
3070
3112
  description: DESCRIPTION9,
3071
3113
  inputSchema: inputSchema8,
3072
3114
  outputSchema: outputSchema9,
3073
3115
  annotations: {
3074
- title: "Search Talonic Workspace",
3116
+ title: "Search documents",
3075
3117
  readOnlyHint: true,
3076
3118
  destructiveHint: false,
3077
3119
  openWorldHint: false
@@ -3144,12 +3186,12 @@ function registerRequestUpload(server, getToken, baseUrl) {
3144
3186
  server.registerTool(
3145
3187
  "talonic_request_upload",
3146
3188
  {
3147
- title: "Request File Upload",
3189
+ title: "Get an upload link",
3148
3190
  description: DESCRIPTION10,
3149
3191
  inputSchema: inputSchema9,
3150
3192
  outputSchema: outputSchema10,
3151
3193
  annotations: {
3152
- title: "Request File Upload",
3194
+ title: "Get an upload link",
3153
3195
  readOnlyHint: false,
3154
3196
  destructiveHint: false,
3155
3197
  openWorldHint: false
@@ -3163,7 +3205,7 @@ var LIST_DESCRIPTION = [
3163
3205
  "List the workspace's accounts: the companies (portfolio companies, clients, entities) whose documents it keeps apart.",
3164
3206
  "",
3165
3207
  "USE WHEN: before uploading a company's files (pass its name as `account` on talonic_request_upload), or to see which companies exist.",
3166
- "NOT FOR: listing documents (talonic_search / talonic_filter) \xB7 creating an account (talonic_create_account).",
3208
+ "NOT FOR: listing documents (talonic_search / talonic_filter) \xB7 creating an account (talonic_create_account). Not a warm-up before answering a question about the documents: call talonic_ask for that.",
3167
3209
  "ARGS: none.",
3168
3210
  "RETURNS: data[] of { id, name, aliases[], description, created_at }."
3169
3211
  ].join("\n");
@@ -3213,13 +3255,13 @@ function registerAccounts(server, getToken, baseUrl) {
3213
3255
  server.registerTool(
3214
3256
  "talonic_list_accounts",
3215
3257
  {
3216
- title: "List Accounts",
3258
+ title: "List companies",
3217
3259
  description: LIST_DESCRIPTION,
3218
3260
  inputSchema: {},
3219
3261
  outputSchema: { data: z.array(z.object(accountShape)).describe("The workspace's accounts.") },
3220
3262
  _meta: widgetToolMeta("listAccounts"),
3221
3263
  annotations: {
3222
- title: "List Accounts",
3264
+ title: "List companies",
3223
3265
  readOnlyHint: true,
3224
3266
  destructiveHint: false,
3225
3267
  openWorldHint: false
@@ -3230,7 +3272,7 @@ function registerAccounts(server, getToken, baseUrl) {
3230
3272
  server.registerTool(
3231
3273
  "talonic_create_account",
3232
3274
  {
3233
- title: "Create Account",
3275
+ title: "Add a company",
3234
3276
  description: CREATE_DESCRIPTION,
3235
3277
  inputSchema: {
3236
3278
  name: z.string().min(1).max(255).describe("Company name, e.g. 'Filu'."),
@@ -3240,7 +3282,7 @@ function registerAccounts(server, getToken, baseUrl) {
3240
3282
  outputSchema: accountShape,
3241
3283
  _meta: widgetToolMeta("createAccount"),
3242
3284
  annotations: {
3243
- title: "Create Account",
3285
+ title: "Add a company",
3244
3286
  readOnlyHint: false,
3245
3287
  destructiveHint: false,
3246
3288
  idempotentHint: false,
@@ -7352,13 +7394,13 @@ function registerAppsTools(server, getToken, baseUrl) {
7352
7394
  server.registerTool(
7353
7395
  "talonic_list_apps",
7354
7396
  {
7355
- title: "List Apps",
7397
+ title: "List apps",
7356
7398
  description: LIST_APPS_DESCRIPTION,
7357
7399
  inputSchema: {
7358
7400
  enabled_only: z.boolean().optional().describe("Only enabled apps (default true). Pass false to include disabled ones.")
7359
7401
  },
7360
7402
  annotations: {
7361
- title: "List Apps",
7403
+ title: "List apps",
7362
7404
  readOnlyHint: true,
7363
7405
  destructiveHint: false,
7364
7406
  idempotentHint: true,
@@ -7732,12 +7774,12 @@ function registerToMarkdown(server, getTalonic, opts = {}) {
7732
7774
  server.registerTool(
7733
7775
  "talonic_to_markdown",
7734
7776
  {
7735
- title: "Document to Markdown",
7777
+ title: "Read document text",
7736
7778
  description: DESCRIPTION11,
7737
7779
  inputSchema: opts.localFiles ? inputSchema10 : hostedInputSchema,
7738
7780
  outputSchema: outputSchema11,
7739
7781
  annotations: {
7740
- title: "Document to Markdown",
7782
+ title: "Read document text",
7741
7783
  readOnlyHint: false,
7742
7784
  destructiveHint: false,
7743
7785
  openWorldHint: true
@@ -7769,7 +7811,7 @@ var LIST_DESCRIPTION3 = [
7769
7811
  "List the workspace's Field Registry \u2014 the canonical concepts Talonic has discovered across every ingested document, each with a stable id, maturity level, data type, synonyms and occurrence count.",
7770
7812
  "",
7771
7813
  "USE WHEN: you need to know WHAT data exists before querying it, want to pick the right concept for a question, or need the exact field id for talonic_get_field / talonic_field_values.",
7772
- "NOT FOR: locating a specific document (talonic_search) or filtering documents by a value (talonic_filter).",
7814
+ "NOT FOR: locating a specific document (talonic_search) or filtering documents by a value (talonic_filter). Not a warm-up before answering a question about the documents: call talonic_ask for that. The registry holds many one-off candidate fields; pass maturity core or proven unless the user asks for candidates.",
7773
7815
  "",
7774
7816
  "ARGS: `search` (case-insensitive contains on name), `maturity` (core | proven | candidate \u2014 prefer `core`/`proven` for anything you will build on), `include_superseded` (default false: rows merged into another concept are hidden so you never see two ids for one concept), `limit`, `cursor`.",
7775
7817
  "RETURNS: data[] of { id, canonical_name, display_name, data_type, maturity, tier, synonyms, description, occurrence_count, superseded_by, links } plus cursor pagination."
@@ -7878,11 +7920,11 @@ function registerFieldTools(server, getToken, baseUrl) {
7878
7920
  server.registerTool(
7879
7921
  "talonic_list_fields",
7880
7922
  {
7881
- title: "List Registry Fields",
7923
+ title: "List fields",
7882
7924
  description: LIST_DESCRIPTION3,
7883
7925
  inputSchema: listFieldsInputSchema,
7884
7926
  annotations: {
7885
- title: "List Registry Fields",
7927
+ title: "List fields",
7886
7928
  readOnlyHint: true,
7887
7929
  destructiveHint: false,
7888
7930
  idempotentHint: true,
@@ -7895,11 +7937,11 @@ function registerFieldTools(server, getToken, baseUrl) {
7895
7937
  server.registerTool(
7896
7938
  "talonic_get_field",
7897
7939
  {
7898
- title: "Get Field Concept Card",
7940
+ title: "Look up a field",
7899
7941
  description: GET_DESCRIPTION2,
7900
7942
  inputSchema: getFieldInputSchema,
7901
7943
  annotations: {
7902
- title: "Get Field Concept Card",
7944
+ title: "Look up a field",
7903
7945
  readOnlyHint: true,
7904
7946
  destructiveHint: false,
7905
7947
  idempotentHint: true,
@@ -7912,11 +7954,11 @@ function registerFieldTools(server, getToken, baseUrl) {
7912
7954
  server.registerTool(
7913
7955
  "talonic_field_values",
7914
7956
  {
7915
- title: "Read Field Values",
7957
+ title: "Read a field's values",
7916
7958
  description: VALUES_DESCRIPTION,
7917
7959
  inputSchema: fieldValuesInputSchema,
7918
7960
  annotations: {
7919
- title: "Read Field Values",
7961
+ title: "Read a field's values",
7920
7962
  readOnlyHint: true,
7921
7963
  destructiveHint: false,
7922
7964
  idempotentHint: true,
@@ -7983,7 +8025,7 @@ var LIST_TOOLS_DESCRIPTION = [
7983
8025
  "Target API: https://talonic.com/docs/api (GET /v1/agent/tools).",
7984
8026
  "",
7985
8027
  "USE WHEN: you want a capability talonic_* tools do not cover directly (e.g. SQL over the structured data, a workspace overview, cohort discovery) \u2014 list here, then call talonic_invoke_agent_tool with the tool name and its args.",
7986
- "NOT FOR: discovering fields (talonic_list_fields / talonic_find_data) or documents (talonic_search) \u2014 those are shaped for you.",
8028
+ "NOT FOR: answering the user's question about their documents \u2014 call talonic_ask, which runs these same tools server-side in one call and returns a cited answer. Also not for discovering fields (talonic_find_data) or documents (talonic_search).",
7987
8029
  "",
7988
8030
  "ARGS: `only_invocable` (default true \u2014 hide tools this credential cannot run), `include_schemas` (default true \u2014 include each tool's JSON input schema).",
7989
8031
  "RETURNS: { tools[] of { name, description, impact, capability, can_invoke, input_schema? }, invocable_count, totalCount }. Registry tools that already have their own talonic_* tool (find_data) are left out; call the dedicated tool."
@@ -8017,12 +8059,12 @@ async function handleListAgentTools(getToken, baseUrl, args) {
8017
8059
  });
8018
8060
  }
8019
8061
  var INVOKE_DESCRIPTION = [
8020
- "Invoke ONE named tool from the platform's agent tool registry directly, with no model in the loop \u2014 you choose the arguments. This is how an external agent uses Talonic's retrieval and provenance while driving control flow itself (e.g. `query_data` for a read-only SQL SELECT over the extracted data, `describe_data` for the queryable field list, `get_document_markdown` to read a document's text).",
8062
+ "Invoke ONE named tool from the platform's agent tool registry directly, with no model in the loop (e.g. `query_data` for a read-only SQL SELECT over the extracted data, `describe_data` for the queryable field list, `get_document_markdown` to read a document's text).",
8021
8063
  "READ-ONLY FOR EVERY CREDENTIAL: the platform runs each caller of this route, API key or OAuth session alike, as its least-privilege viewer role, which grants only the registry's read-only tools (capability `data.read`). Write-capable registry tools are never invocable here, however you connected, so this tool reads and never changes workspace data.",
8022
8064
  "Target API: Talonic agent tool registry \u2014 https://talonic.com/docs/api (POST /v1/agent/tools/{name}/invoke; input schemas from talonic_list_agent_tools).",
8023
8065
  "",
8024
8066
  "USE WHEN: talonic_list_agent_tools showed a tool with can_invoke: true that does what you need. Pass exactly the `args` its input_schema declares.",
8025
- "NOT FOR: anything a dedicated talonic_* tool already does (prefer those \u2014 they are shaped for you).",
8067
+ "NOT FOR: answering a question about the documents (talonic_ask runs these tools server-side and returns one cited answer). Use this only for a query the user asked for, or when talonic_ask could not answer.",
8026
8068
  "",
8027
8069
  "ARGS: `name` (tool name), `args` (object matching the tool's input_schema), optional `document_ids` (hard scope for scope-aware tools).",
8028
8070
  "RETURNS: { tool, result (the tool's parsed output), citations?, artifacts?, cards? }. Denied capabilities come back as an error naming the capability required; the platform re-checks every call."
@@ -8053,11 +8095,11 @@ function registerAgentRegistryTools(server, getToken, baseUrl, opts = {}) {
8053
8095
  server.registerTool(
8054
8096
  "talonic_find_data",
8055
8097
  {
8056
- title: "Find Data by Concept",
8098
+ title: "Find where data lives",
8057
8099
  description: FIND_DESCRIPTION,
8058
8100
  inputSchema: findDataInputSchema,
8059
8101
  annotations: {
8060
- title: "Find Data by Concept",
8102
+ title: "Find where data lives",
8061
8103
  readOnlyHint: true,
8062
8104
  destructiveHint: false,
8063
8105
  idempotentHint: true,
@@ -8071,11 +8113,11 @@ function registerAgentRegistryTools(server, getToken, baseUrl, opts = {}) {
8071
8113
  server.registerTool(
8072
8114
  "talonic_list_agent_tools",
8073
8115
  {
8074
- title: "List Platform Agent Tools",
8116
+ title: "List data tools",
8075
8117
  description: LIST_TOOLS_DESCRIPTION,
8076
8118
  inputSchema: listAgentToolsInputSchema,
8077
8119
  annotations: {
8078
- title: "List Platform Agent Tools",
8120
+ title: "List data tools",
8079
8121
  readOnlyHint: true,
8080
8122
  destructiveHint: false,
8081
8123
  idempotentHint: true,
@@ -8088,11 +8130,11 @@ function registerAgentRegistryTools(server, getToken, baseUrl, opts = {}) {
8088
8130
  server.registerTool(
8089
8131
  "talonic_invoke_agent_tool",
8090
8132
  {
8091
- title: "Invoke Platform Agent Tool",
8133
+ title: "Query workspace data",
8092
8134
  description: INVOKE_DESCRIPTION,
8093
8135
  inputSchema: invokeAgentToolInputSchema,
8094
8136
  annotations: {
8095
- title: "Invoke Platform Agent Tool",
8137
+ title: "Query workspace data",
8096
8138
  readOnlyHint: true,
8097
8139
  destructiveHint: false,
8098
8140
  idempotentHint: false,
@@ -8107,7 +8149,7 @@ var LIST_DESCRIPTION4 = [
8107
8149
  "List the workspace's Specs. A Spec is a saved extraction pipeline: an ordered list of processing steps plus the fields it produces; talonic_run_spec runs it over documents. Each row: id, name, description, schema_id (the schema the run's output rows follow \u2014 a DIFFERENT id from the Spec's), version / materialized_version (the published version runs use; null = never published), field_count, node_count, timestamps.",
8108
8150
  "",
8109
8151
  "USE WHEN: the user wants to run 'their pipeline' / 'the invoice Spec', or you need a spec_id for talonic_run_spec / talonic_get_spec.",
8110
- "NOT FOR: ad-hoc extraction schemas (talonic_list_schemas) or discovering fields (talonic_list_fields).",
8152
+ "NOT FOR: ad-hoc extraction schemas (talonic_list_schemas) or discovering fields (talonic_list_fields). Not a warm-up before answering a question about the documents: call talonic_ask for that.",
8111
8153
  "ARGS: optional `search` (name contains, case-insensitive), `limit` (1\u2013100, default 20), `cursor` (from pagination.next_cursor), `order` (asc|desc by updated_at).",
8112
8154
  "RETURNS: { data[] of { id, name, description, schema_id, version, materialized_version, materialized_at, field_count, node_count, created_at, updated_at, links }, pagination { total, limit, has_more, next_cursor } }."
8113
8155
  ].join("\n");
@@ -8162,10 +8204,10 @@ function registerSpecTools(server, getToken, baseUrl) {
8162
8204
  server.registerTool(
8163
8205
  "talonic_list_specs",
8164
8206
  {
8165
- title: "List Specs",
8207
+ title: "List pipelines",
8166
8208
  description: LIST_DESCRIPTION4,
8167
8209
  inputSchema: listSpecsInputSchema,
8168
- annotations: { title: "List Specs", ...READ_ONLY4 },
8210
+ annotations: { title: "List pipelines", ...READ_ONLY4 },
8169
8211
  _meta: widgetToolMeta("listSpecs")
8170
8212
  },
8171
8213
  async (args) => handleListSpecs(getToken, baseUrl, args)
@@ -8173,10 +8215,10 @@ function registerSpecTools(server, getToken, baseUrl) {
8173
8215
  server.registerTool(
8174
8216
  "talonic_get_spec",
8175
8217
  {
8176
- title: "Get a Spec's structure",
8218
+ title: "Look up a pipeline",
8177
8219
  description: GET_DESCRIPTION3,
8178
8220
  inputSchema: getSpecInputSchema,
8179
- annotations: { title: "Get a Spec's structure", ...READ_ONLY4 },
8221
+ annotations: { title: "Look up a pipeline", ...READ_ONLY4 },
8180
8222
  _meta: widgetToolMeta("getSpec")
8181
8223
  },
8182
8224
  async (args) => handleGetSpec(getToken, baseUrl, args)
@@ -8402,11 +8444,11 @@ function registerRunTools(server, getToken, baseUrl) {
8402
8444
  server.registerTool(
8403
8445
  "talonic_run_spec",
8404
8446
  {
8405
- title: "Run a Spec pipeline",
8447
+ title: "Run a pipeline",
8406
8448
  description: RUN_DESCRIPTION2,
8407
8449
  inputSchema: runSpecInputSchema,
8408
8450
  annotations: {
8409
- title: "Run a Spec pipeline",
8451
+ title: "Run a pipeline",
8410
8452
  readOnlyHint: false,
8411
8453
  destructiveHint: false,
8412
8454
  openWorldHint: true
@@ -8418,10 +8460,10 @@ function registerRunTools(server, getToken, baseUrl) {
8418
8460
  server.registerTool(
8419
8461
  "talonic_get_run",
8420
8462
  {
8421
- title: "Poll a Spec run",
8463
+ title: "Check run progress",
8422
8464
  description: GET_RUN_DESCRIPTION,
8423
8465
  inputSchema: runRefInputSchema,
8424
- annotations: { title: "Poll a Spec run", ...READ_ONLY5 },
8466
+ annotations: { title: "Check run progress", ...READ_ONLY5 },
8425
8467
  _meta: widgetToolMeta("getRun")
8426
8468
  },
8427
8469
  async (args) => handleGetRun(getToken, baseUrl, args)
@@ -8429,10 +8471,10 @@ function registerRunTools(server, getToken, baseUrl) {
8429
8471
  server.registerTool(
8430
8472
  "talonic_get_run_results",
8431
8473
  {
8432
- title: "Read a Spec run's rows",
8474
+ title: "Read run results",
8433
8475
  description: RESULTS_DESCRIPTION,
8434
8476
  inputSchema: resultsInputSchema,
8435
- annotations: { title: "Read a Spec run's rows", ...READ_ONLY5 },
8477
+ annotations: { title: "Read run results", ...READ_ONLY5 },
8436
8478
  _meta: widgetToolMeta("getRunResults")
8437
8479
  },
8438
8480
  async (args) => handleGetRunResults(getToken, baseUrl, args)
@@ -8445,7 +8487,7 @@ var POLL_HINT = "still processing \u2014 call talonic_get_answer with this ask_i
8445
8487
  var ASK_DESCRIPTION = [
8446
8488
  "Ask a natural-language question over the workspace's documents and get a cited, verified answer (markdown). The Talonic agent plans over the workspace's extracted fields, runs read-only SQL over extracted cells, reads document text, and grounds every load-bearing claim in a source span. Consumes credits.",
8447
8489
  "",
8448
- "USE WHEN: the user asks an open question about their documents ('which vendors invoiced us twice in May?'), wants a summary across documents, or the answer needs reasoning over several fields.",
8490
+ "USE WHEN (the default for questions): the user asks anything about what their documents contain \u2014 counts, totals, duplicates, comparisons, anomalies ('which vendors invoiced us twice in May?'), or a summary across documents. One call replaces exploring fields, schemas, specs and SQL yourself; skip that exploration.",
8449
8491
  "NOT FOR: reading a known field's values (talonic_field_values, free) or filtering documents by a known value (talonic_filter, free); locating which field holds a concept (talonic_find_data).",
8450
8492
  "ARGS: `question`; optional `scope` { document_ids[], schema_id, pipeline_id, data_product_id, document_type, source_id, tags[], ingested_after, ingested_before } (ANDed), `conversation_id` (continue a thread), `output_format` { instruction, template }, `wait_seconds` (0\u201355, default 45).",
8451
8493
  "RETURNS: { ask_id, status ('completed'|'processing'|'error'), conversation_id, answer (markdown), citations[] { quote, document_id, kind, filename, app_url }, verification { verdict, checks_total, checks_unsupported, correction }, usage { tokens, credits_charged }, tool_calls, artifacts[], waited_ms }. If status is still 'processing' after the wait, call talonic_get_answer with the ask_id."
@@ -8545,11 +8587,11 @@ function registerAskTools(server, getToken, baseUrl) {
8545
8587
  server.registerTool(
8546
8588
  "talonic_ask",
8547
8589
  {
8548
- title: "Ask a question over the workspace",
8590
+ title: "Ask your documents",
8549
8591
  description: ASK_DESCRIPTION,
8550
8592
  inputSchema: askInputSchema,
8551
8593
  annotations: {
8552
- title: "Ask a question over the workspace",
8594
+ title: "Ask your documents",
8553
8595
  readOnlyHint: false,
8554
8596
  destructiveHint: false,
8555
8597
  openWorldHint: false
@@ -8561,11 +8603,11 @@ function registerAskTools(server, getToken, baseUrl) {
8561
8603
  server.registerTool(
8562
8604
  "talonic_get_answer",
8563
8605
  {
8564
- title: "Poll an ask for its answer",
8606
+ title: "Get the answer",
8565
8607
  description: GET_ANSWER_DESCRIPTION,
8566
8608
  inputSchema: { ask_id: uuid2.describe("From talonic_ask.") },
8567
8609
  annotations: {
8568
- title: "Poll an ask for its answer",
8610
+ title: "Get the answer",
8569
8611
  readOnlyHint: true,
8570
8612
  destructiveHint: false,
8571
8613
  idempotentHint: true,
@@ -8579,7 +8621,7 @@ function registerAskTools(server, getToken, baseUrl) {
8579
8621
 
8580
8622
  // package.json
8581
8623
  var package_default = {
8582
- version: "0.1.96"};
8624
+ version: "0.1.98"};
8583
8625
 
8584
8626
  // src/version.ts
8585
8627
  var VERSION = package_default.version;
@@ -8604,6 +8646,9 @@ function buildServerInstructions(opts) {
8604
8646
  "schema-validated JSON with per-field confidence scores and source provenance, and",
8605
8647
  "answers questions about the documents in the user's Talonic workspace.",
8606
8648
  "Which tool for which question:",
8649
+ "(0) any question about what the documents contain (counts, totals, duplicates,",
8650
+ "comparisons, anomalies) -> talonic_ask FIRST, in one call; do not explore fields,",
8651
+ "schemas, specs or SQL to answer it yourself;",
8607
8652
  "(1) a document by name or keyword -> talonic_search (literal keywords: one short term",
8608
8653
  "or an exact filename; on an empty result retry with a shorter keyword), then use the",
8609
8654
  "returned document_id;",