@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/server.js CHANGED
@@ -444,15 +444,30 @@ var WIDGET_DESCRIPTIONS = {
444
444
  releaseDecisionTask: "Confirmation that the decision task was released back to available for another claimant.",
445
445
  failDecisionTask: "Confirmation that the task was reported undecidable: a Human Review is raised and the app's fallback applies."
446
446
  };
447
+ var CARD_TOOL_KEYS = /* @__PURE__ */ new Set([
448
+ "extract",
449
+ "ask",
450
+ "getAnswer",
451
+ "getRunResults",
452
+ "requestUpload",
453
+ "getBalance",
454
+ "getUsage",
455
+ "getPricing",
456
+ "saveSchema",
457
+ "createAccount"
458
+ ]);
447
459
  function widgetToolMeta(key) {
448
460
  const uri = WIDGET_URIS[key];
449
461
  const status3 = TOOL_INVOCATION_STATUS[key];
450
- return {
451
- ui: { resourceUri: uri },
452
- "openai/outputTemplate": uri,
462
+ const meta = {
453
463
  "openai/toolInvocation/invoking": status3.invoking,
454
464
  "openai/toolInvocation/invoked": status3.invoked
455
465
  };
466
+ if (CARD_TOOL_KEYS.has(key)) {
467
+ meta["ui"] = { resourceUri: uri };
468
+ meta["openai/outputTemplate"] = uri;
469
+ }
470
+ return meta;
456
471
  }
457
472
 
458
473
  // src/widgets/shared.ts
@@ -561,6 +576,33 @@ var BASE_CSS = `
561
576
  details.tree > summary { cursor: pointer; font-size: 13px; list-style: none; }
562
577
  details.tree > summary::before { content: "\u25B8 "; color: var(--muted); }
563
578
  details.tree[open] > summary::before { content: "\u25BE "; }
579
+ .loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px; color: var(--muted); }
580
+ .tl-mark { color: var(--accent); }
581
+ .tl-mark g, .tl-mark circle { transform-box: view-box; transform-origin: 0 0; }
582
+ .tl-layer { fill: none; stroke: currentColor; stroke-width: 20; stroke-linecap: round; }
583
+ .tl-spin { animation: tl-spin 4s infinite; }
584
+ .tl-core { animation: tl-core 4s infinite; }
585
+ .tl-arm { animation: tl-arm 4s infinite; animation-delay: calc(4s * var(--i) * -0.0075); }
586
+ @keyframes tl-spin {
587
+ 0% { transform: rotate(0deg); animation-timing-function: cubic-bezier(.55, 0, .9, .45); }
588
+ 42% { transform: rotate(560deg); animation-timing-function: linear; }
589
+ 58% { transform: rotate(860deg); animation-timing-function: cubic-bezier(.1, .6, .25, 1); }
590
+ 100% { transform: rotate(1080deg); }
591
+ }
592
+ @keyframes tl-arm {
593
+ 0%, 24% { transform: scale(1); animation-timing-function: cubic-bezier(.6, 0, .85, .3); }
594
+ 48% { transform: scale(.06); animation-timing-function: linear; }
595
+ 60% { transform: scale(.06); animation-timing-function: cubic-bezier(.2, 1.5, .35, 1); }
596
+ 84%, 100% { transform: scale(1); }
597
+ }
598
+ @keyframes tl-core {
599
+ 0%, 28% { transform: scale(1); animation-timing-function: cubic-bezier(.6, 0, .85, .3); }
600
+ 48% { transform: scale(.5); animation-timing-function: ease-in-out; }
601
+ 58% { transform: scale(.44); animation-timing-function: cubic-bezier(.2, 1.6, .4, 1); }
602
+ 74% { transform: scale(1.1); animation-timing-function: ease-in-out; }
603
+ 88%, 100% { transform: scale(1); }
604
+ }
605
+ @media (prefers-reduced-motion: reduce) { .tl-spin, .tl-core, .tl-arm { animation: none; } }
564
606
  `;
565
607
  var HELPERS_JS = `
566
608
  var root = document.getElementById("root");
@@ -809,7 +851,7 @@ ${opts.css ?? ""}
809
851
  </style>
810
852
  </head>
811
853
  <body>
812
- <div id="root" class="root"><div class="empty">Loading\u2026</div></div>
854
+ <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>
813
855
  <script>
814
856
  (function () {
815
857
  ${HELPERS_JS}
@@ -1850,9 +1892,9 @@ var RENDER_BODY27 = `
1850
1892
  var pg = payload.pagination && typeof payload.pagination === "object" ? payload.pagination : {};
1851
1893
  if (!rows.length) { empty("No result rows yet."); return; }
1852
1894
  function tone(s) { return s === "complete" || s === "completed" ? "good" : s === "error" ? "bad" : s === "partial" ? "warn" : "info"; }
1853
- var shownCols = cols.slice(0, 10);
1895
+ var shownCols = cols.slice(0, 6);
1854
1896
  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>';
1855
- var body = rows.slice(0, 50).map(function (r) {
1897
+ var body = rows.slice(0, 12).map(function (r) {
1856
1898
  r = r && typeof r === "object" ? r : {};
1857
1899
  var f = r.fields && typeof r.fields === "object" ? r.fields : {};
1858
1900
  return '<tr><td class="val">' + esc(r.filename || shortId(r.document_id)) + '</td><td>' + chip(r.status, tone(r.status)) + '</td>'
@@ -1861,10 +1903,10 @@ var RENDER_BODY27 = `
1861
1903
  var total = typeof pg.total === "number" ? pg.total : rows.length;
1862
1904
  var held = typeof payload.pending_review_count === "number" ? payload.pending_review_count : 0;
1863
1905
  var more = [];
1864
- if (rows.length > 50) more.push("+" + (rows.length - 50) + " more rows");
1865
- if (cols.length > 10) more.push("+" + (cols.length - 10) + " more columns");
1906
+ if (rows.length > 12) more.push("+" + (rows.length - 12) + " more rows");
1907
+ if (cols.length > 6) more.push("+" + (cols.length - 6) + " more columns");
1866
1908
  root.innerHTML = ''
1867
- + '<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>'
1909
+ + '<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>'
1868
1910
  + '<div>' + chip(payload.status, payload.status === "completed" ? "good" : payload.status === "failed" ? "bad" : "info") + (held ? chip(held + " held for review", "warn") : "") + '</div></div>'
1869
1911
  + '<table><thead>' + head + '</thead><tbody>' + body + '</tbody></table>'
1870
1912
  + (more.length ? '<div class="muted small" style="margin-top:6px">' + esc(more.join(" \xB7 ")) + '</div>' : "");
@@ -2433,12 +2475,12 @@ function registerExtract(server, getTalonic, opts = {}) {
2433
2475
  server.registerTool(
2434
2476
  "talonic_extract",
2435
2477
  {
2436
- title: "Extract Data from Document",
2478
+ title: "Extract data",
2437
2479
  description: DESCRIPTION,
2438
2480
  inputSchema: opts.localFiles ? inputSchema : hostedInputSchema,
2439
2481
  outputSchema,
2440
2482
  annotations: {
2441
- title: "Extract Data from Document",
2483
+ title: "Extract data",
2442
2484
  readOnlyHint: false,
2443
2485
  destructiveHint: false,
2444
2486
  openWorldHint: true
@@ -2562,12 +2604,12 @@ function registerFilter(server, getTalonic) {
2562
2604
  server.registerTool(
2563
2605
  "talonic_filter",
2564
2606
  {
2565
- title: "Filter Talonic Documents",
2607
+ title: "Filter documents",
2566
2608
  description: DESCRIPTION2,
2567
2609
  inputSchema: inputSchema2,
2568
2610
  outputSchema: outputSchema2,
2569
2611
  annotations: {
2570
- title: "Filter Talonic Documents",
2612
+ title: "Filter documents",
2571
2613
  readOnlyHint: true,
2572
2614
  destructiveHint: false,
2573
2615
  openWorldHint: false
@@ -2608,12 +2650,12 @@ function registerGetBalance(server, getTalonic) {
2608
2650
  server.registerTool(
2609
2651
  "talonic_get_balance",
2610
2652
  {
2611
- title: "Get Talonic Credit Balance",
2653
+ title: "Check credit balance",
2612
2654
  description: DESCRIPTION3,
2613
2655
  inputSchema: inputSchema3,
2614
2656
  outputSchema: outputSchema3,
2615
2657
  annotations: {
2616
- title: "Get Talonic Credit Balance",
2658
+ title: "Check credit balance",
2617
2659
  readOnlyHint: true,
2618
2660
  destructiveHint: false,
2619
2661
  openWorldHint: false
@@ -2660,12 +2702,12 @@ function registerGetPricing(server, getTalonic) {
2660
2702
  server.registerTool(
2661
2703
  "talonic_get_pricing",
2662
2704
  {
2663
- title: "Get Talonic Pricing",
2705
+ title: "Check pricing",
2664
2706
  description: DESCRIPTION4,
2665
2707
  inputSchema: inputSchema4,
2666
2708
  outputSchema: outputSchema4,
2667
2709
  annotations: {
2668
- title: "Get Talonic Pricing",
2710
+ title: "Check pricing",
2669
2711
  readOnlyHint: true,
2670
2712
  destructiveHint: false,
2671
2713
  openWorldHint: false
@@ -2709,12 +2751,12 @@ function registerGetUsage(server, getTalonic) {
2709
2751
  server.registerTool(
2710
2752
  "talonic_get_usage",
2711
2753
  {
2712
- title: "Get Talonic Usage",
2754
+ title: "Check credit usage",
2713
2755
  description: DESCRIPTION5,
2714
2756
  inputSchema: inputSchema5,
2715
2757
  outputSchema: outputSchema5,
2716
2758
  annotations: {
2717
- title: "Get Talonic Usage",
2759
+ title: "Check credit usage",
2718
2760
  readOnlyHint: true,
2719
2761
  destructiveHint: false,
2720
2762
  openWorldHint: false
@@ -2800,12 +2842,12 @@ function registerGetDocument(server, getTalonic) {
2800
2842
  server.registerTool(
2801
2843
  "talonic_get_document",
2802
2844
  {
2803
- title: "Get Talonic Document",
2845
+ title: "Look up a document",
2804
2846
  description: DESCRIPTION6,
2805
2847
  inputSchema: inputSchema6,
2806
2848
  outputSchema: outputSchema6,
2807
2849
  annotations: {
2808
- title: "Get Talonic Document",
2850
+ title: "Look up a document",
2809
2851
  readOnlyHint: true,
2810
2852
  destructiveHint: false,
2811
2853
  openWorldHint: false
@@ -2819,7 +2861,7 @@ var DESCRIPTION7 = [
2819
2861
  "List the saved schemas in the workspace as compact summaries (id, short_id, name, description, version, field_count).",
2820
2862
  "",
2821
2863
  "USE WHEN: 'what schemas do I have', or to find a reusable schema before extracting.",
2822
- "NOT FOR: a one-off extraction with an inline schema (call talonic_extract directly).",
2864
+ "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.",
2823
2865
  "ARGS: none.",
2824
2866
  "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`."
2825
2867
  ].join("\n");
@@ -2870,12 +2912,12 @@ function registerListSchemas(server, getTalonic) {
2870
2912
  server.registerTool(
2871
2913
  "talonic_list_schemas",
2872
2914
  {
2873
- title: "List Talonic Schemas",
2915
+ title: "List saved schemas",
2874
2916
  description: DESCRIPTION7,
2875
2917
  inputSchema: {},
2876
2918
  outputSchema: outputSchema7,
2877
2919
  annotations: {
2878
- title: "List Talonic Schemas",
2920
+ title: "List saved schemas",
2879
2921
  readOnlyHint: true,
2880
2922
  destructiveHint: false,
2881
2923
  openWorldHint: false
@@ -2905,13 +2947,13 @@ function registerGetSchema(server, getTalonic) {
2905
2947
  server.registerTool(
2906
2948
  "talonic_get_schema",
2907
2949
  {
2908
- title: "Get Talonic Schema",
2950
+ title: "Read a schema's fields",
2909
2951
  description: GET_DESCRIPTION,
2910
2952
  inputSchema: {
2911
2953
  schema_id: z.string().min(1).describe("Schema id (UUID) or short_id (SCH-XXXXXXXX) from talonic_list_schemas.")
2912
2954
  },
2913
2955
  annotations: {
2914
- title: "Get Talonic Schema",
2956
+ title: "Read a schema's fields",
2915
2957
  readOnlyHint: true,
2916
2958
  destructiveHint: false,
2917
2959
  idempotentHint: true,
@@ -2971,12 +3013,12 @@ function registerSaveSchema(server, getTalonic) {
2971
3013
  server.registerTool(
2972
3014
  "talonic_save_schema",
2973
3015
  {
2974
- title: "Save Talonic Schema",
3016
+ title: "Save a schema",
2975
3017
  description: DESCRIPTION8,
2976
3018
  inputSchema: inputSchema7,
2977
3019
  outputSchema: outputSchema8,
2978
3020
  annotations: {
2979
- title: "Save Talonic Schema",
3021
+ title: "Save a schema",
2980
3022
  readOnlyHint: false,
2981
3023
  destructiveHint: false,
2982
3024
  openWorldHint: false
@@ -3069,12 +3111,12 @@ function registerSearch(server, getTalonic) {
3069
3111
  server.registerTool(
3070
3112
  "talonic_search",
3071
3113
  {
3072
- title: "Search Talonic Workspace",
3114
+ title: "Search documents",
3073
3115
  description: DESCRIPTION9,
3074
3116
  inputSchema: inputSchema8,
3075
3117
  outputSchema: outputSchema9,
3076
3118
  annotations: {
3077
- title: "Search Talonic Workspace",
3119
+ title: "Search documents",
3078
3120
  readOnlyHint: true,
3079
3121
  destructiveHint: false,
3080
3122
  openWorldHint: false
@@ -3147,12 +3189,12 @@ function registerRequestUpload(server, getToken, baseUrl) {
3147
3189
  server.registerTool(
3148
3190
  "talonic_request_upload",
3149
3191
  {
3150
- title: "Request File Upload",
3192
+ title: "Get an upload link",
3151
3193
  description: DESCRIPTION10,
3152
3194
  inputSchema: inputSchema9,
3153
3195
  outputSchema: outputSchema10,
3154
3196
  annotations: {
3155
- title: "Request File Upload",
3197
+ title: "Get an upload link",
3156
3198
  readOnlyHint: false,
3157
3199
  destructiveHint: false,
3158
3200
  openWorldHint: false
@@ -3166,7 +3208,7 @@ var LIST_DESCRIPTION = [
3166
3208
  "List the workspace's accounts: the companies (portfolio companies, clients, entities) whose documents it keeps apart.",
3167
3209
  "",
3168
3210
  "USE WHEN: before uploading a company's files (pass its name as `account` on talonic_request_upload), or to see which companies exist.",
3169
- "NOT FOR: listing documents (talonic_search / talonic_filter) \xB7 creating an account (talonic_create_account).",
3211
+ "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.",
3170
3212
  "ARGS: none.",
3171
3213
  "RETURNS: data[] of { id, name, aliases[], description, created_at }."
3172
3214
  ].join("\n");
@@ -3216,13 +3258,13 @@ function registerAccounts(server, getToken, baseUrl) {
3216
3258
  server.registerTool(
3217
3259
  "talonic_list_accounts",
3218
3260
  {
3219
- title: "List Accounts",
3261
+ title: "List companies",
3220
3262
  description: LIST_DESCRIPTION,
3221
3263
  inputSchema: {},
3222
3264
  outputSchema: { data: z.array(z.object(accountShape)).describe("The workspace's accounts.") },
3223
3265
  _meta: widgetToolMeta("listAccounts"),
3224
3266
  annotations: {
3225
- title: "List Accounts",
3267
+ title: "List companies",
3226
3268
  readOnlyHint: true,
3227
3269
  destructiveHint: false,
3228
3270
  openWorldHint: false
@@ -3233,7 +3275,7 @@ function registerAccounts(server, getToken, baseUrl) {
3233
3275
  server.registerTool(
3234
3276
  "talonic_create_account",
3235
3277
  {
3236
- title: "Create Account",
3278
+ title: "Add a company",
3237
3279
  description: CREATE_DESCRIPTION,
3238
3280
  inputSchema: {
3239
3281
  name: z.string().min(1).max(255).describe("Company name, e.g. 'Filu'."),
@@ -3243,7 +3285,7 @@ function registerAccounts(server, getToken, baseUrl) {
3243
3285
  outputSchema: accountShape,
3244
3286
  _meta: widgetToolMeta("createAccount"),
3245
3287
  annotations: {
3246
- title: "Create Account",
3288
+ title: "Add a company",
3247
3289
  readOnlyHint: false,
3248
3290
  destructiveHint: false,
3249
3291
  idempotentHint: false,
@@ -7465,13 +7507,13 @@ function registerAppsTools(server, getToken, baseUrl) {
7465
7507
  server.registerTool(
7466
7508
  "talonic_list_apps",
7467
7509
  {
7468
- title: "List Apps",
7510
+ title: "List apps",
7469
7511
  description: LIST_APPS_DESCRIPTION,
7470
7512
  inputSchema: {
7471
7513
  enabled_only: z.boolean().optional().describe("Only enabled apps (default true). Pass false to include disabled ones.")
7472
7514
  },
7473
7515
  annotations: {
7474
- title: "List Apps",
7516
+ title: "List apps",
7475
7517
  readOnlyHint: true,
7476
7518
  destructiveHint: false,
7477
7519
  idempotentHint: true,
@@ -7845,12 +7887,12 @@ function registerToMarkdown(server, getTalonic, opts = {}) {
7845
7887
  server.registerTool(
7846
7888
  "talonic_to_markdown",
7847
7889
  {
7848
- title: "Document to Markdown",
7890
+ title: "Read document text",
7849
7891
  description: DESCRIPTION11,
7850
7892
  inputSchema: opts.localFiles ? inputSchema10 : hostedInputSchema,
7851
7893
  outputSchema: outputSchema11,
7852
7894
  annotations: {
7853
- title: "Document to Markdown",
7895
+ title: "Read document text",
7854
7896
  readOnlyHint: false,
7855
7897
  destructiveHint: false,
7856
7898
  openWorldHint: true
@@ -7882,7 +7924,7 @@ var LIST_DESCRIPTION3 = [
7882
7924
  "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.",
7883
7925
  "",
7884
7926
  "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.",
7885
- "NOT FOR: locating a specific document (talonic_search) or filtering documents by a value (talonic_filter).",
7927
+ "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.",
7886
7928
  "",
7887
7929
  "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`.",
7888
7930
  "RETURNS: data[] of { id, canonical_name, display_name, data_type, maturity, tier, synonyms, description, occurrence_count, superseded_by, links } plus cursor pagination."
@@ -7991,11 +8033,11 @@ function registerFieldTools(server, getToken, baseUrl) {
7991
8033
  server.registerTool(
7992
8034
  "talonic_list_fields",
7993
8035
  {
7994
- title: "List Registry Fields",
8036
+ title: "List fields",
7995
8037
  description: LIST_DESCRIPTION3,
7996
8038
  inputSchema: listFieldsInputSchema,
7997
8039
  annotations: {
7998
- title: "List Registry Fields",
8040
+ title: "List fields",
7999
8041
  readOnlyHint: true,
8000
8042
  destructiveHint: false,
8001
8043
  idempotentHint: true,
@@ -8008,11 +8050,11 @@ function registerFieldTools(server, getToken, baseUrl) {
8008
8050
  server.registerTool(
8009
8051
  "talonic_get_field",
8010
8052
  {
8011
- title: "Get Field Concept Card",
8053
+ title: "Look up a field",
8012
8054
  description: GET_DESCRIPTION2,
8013
8055
  inputSchema: getFieldInputSchema,
8014
8056
  annotations: {
8015
- title: "Get Field Concept Card",
8057
+ title: "Look up a field",
8016
8058
  readOnlyHint: true,
8017
8059
  destructiveHint: false,
8018
8060
  idempotentHint: true,
@@ -8025,11 +8067,11 @@ function registerFieldTools(server, getToken, baseUrl) {
8025
8067
  server.registerTool(
8026
8068
  "talonic_field_values",
8027
8069
  {
8028
- title: "Read Field Values",
8070
+ title: "Read a field's values",
8029
8071
  description: VALUES_DESCRIPTION,
8030
8072
  inputSchema: fieldValuesInputSchema,
8031
8073
  annotations: {
8032
- title: "Read Field Values",
8074
+ title: "Read a field's values",
8033
8075
  readOnlyHint: true,
8034
8076
  destructiveHint: false,
8035
8077
  idempotentHint: true,
@@ -8096,7 +8138,7 @@ var LIST_TOOLS_DESCRIPTION = [
8096
8138
  "Target API: https://talonic.com/docs/api (GET /v1/agent/tools).",
8097
8139
  "",
8098
8140
  "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.",
8099
- "NOT FOR: discovering fields (talonic_list_fields / talonic_find_data) or documents (talonic_search) \u2014 those are shaped for you.",
8141
+ "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).",
8100
8142
  "",
8101
8143
  "ARGS: `only_invocable` (default true \u2014 hide tools this credential cannot run), `include_schemas` (default true \u2014 include each tool's JSON input schema).",
8102
8144
  "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."
@@ -8130,12 +8172,12 @@ async function handleListAgentTools(getToken, baseUrl, args) {
8130
8172
  });
8131
8173
  }
8132
8174
  var INVOKE_DESCRIPTION = [
8133
- "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).",
8175
+ "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).",
8134
8176
  "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.",
8135
8177
  "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).",
8136
8178
  "",
8137
8179
  "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.",
8138
- "NOT FOR: anything a dedicated talonic_* tool already does (prefer those \u2014 they are shaped for you).",
8180
+ "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.",
8139
8181
  "",
8140
8182
  "ARGS: `name` (tool name), `args` (object matching the tool's input_schema), optional `document_ids` (hard scope for scope-aware tools).",
8141
8183
  "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."
@@ -8166,11 +8208,11 @@ function registerAgentRegistryTools(server, getToken, baseUrl, opts = {}) {
8166
8208
  server.registerTool(
8167
8209
  "talonic_find_data",
8168
8210
  {
8169
- title: "Find Data by Concept",
8211
+ title: "Find where data lives",
8170
8212
  description: FIND_DESCRIPTION,
8171
8213
  inputSchema: findDataInputSchema,
8172
8214
  annotations: {
8173
- title: "Find Data by Concept",
8215
+ title: "Find where data lives",
8174
8216
  readOnlyHint: true,
8175
8217
  destructiveHint: false,
8176
8218
  idempotentHint: true,
@@ -8184,11 +8226,11 @@ function registerAgentRegistryTools(server, getToken, baseUrl, opts = {}) {
8184
8226
  server.registerTool(
8185
8227
  "talonic_list_agent_tools",
8186
8228
  {
8187
- title: "List Platform Agent Tools",
8229
+ title: "List data tools",
8188
8230
  description: LIST_TOOLS_DESCRIPTION,
8189
8231
  inputSchema: listAgentToolsInputSchema,
8190
8232
  annotations: {
8191
- title: "List Platform Agent Tools",
8233
+ title: "List data tools",
8192
8234
  readOnlyHint: true,
8193
8235
  destructiveHint: false,
8194
8236
  idempotentHint: true,
@@ -8201,11 +8243,11 @@ function registerAgentRegistryTools(server, getToken, baseUrl, opts = {}) {
8201
8243
  server.registerTool(
8202
8244
  "talonic_invoke_agent_tool",
8203
8245
  {
8204
- title: "Invoke Platform Agent Tool",
8246
+ title: "Query workspace data",
8205
8247
  description: INVOKE_DESCRIPTION,
8206
8248
  inputSchema: invokeAgentToolInputSchema,
8207
8249
  annotations: {
8208
- title: "Invoke Platform Agent Tool",
8250
+ title: "Query workspace data",
8209
8251
  readOnlyHint: true,
8210
8252
  destructiveHint: false,
8211
8253
  idempotentHint: false,
@@ -8220,7 +8262,7 @@ var LIST_DESCRIPTION4 = [
8220
8262
  "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.",
8221
8263
  "",
8222
8264
  "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.",
8223
- "NOT FOR: ad-hoc extraction schemas (talonic_list_schemas) or discovering fields (talonic_list_fields).",
8265
+ "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.",
8224
8266
  "ARGS: optional `search` (name contains, case-insensitive), `limit` (1\u2013100, default 20), `cursor` (from pagination.next_cursor), `order` (asc|desc by updated_at).",
8225
8267
  "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 } }."
8226
8268
  ].join("\n");
@@ -8275,10 +8317,10 @@ function registerSpecTools(server, getToken, baseUrl) {
8275
8317
  server.registerTool(
8276
8318
  "talonic_list_specs",
8277
8319
  {
8278
- title: "List Specs",
8320
+ title: "List pipelines",
8279
8321
  description: LIST_DESCRIPTION4,
8280
8322
  inputSchema: listSpecsInputSchema,
8281
- annotations: { title: "List Specs", ...READ_ONLY4 },
8323
+ annotations: { title: "List pipelines", ...READ_ONLY4 },
8282
8324
  _meta: widgetToolMeta("listSpecs")
8283
8325
  },
8284
8326
  async (args) => handleListSpecs(getToken, baseUrl, args)
@@ -8286,10 +8328,10 @@ function registerSpecTools(server, getToken, baseUrl) {
8286
8328
  server.registerTool(
8287
8329
  "talonic_get_spec",
8288
8330
  {
8289
- title: "Get a Spec's structure",
8331
+ title: "Look up a pipeline",
8290
8332
  description: GET_DESCRIPTION3,
8291
8333
  inputSchema: getSpecInputSchema,
8292
- annotations: { title: "Get a Spec's structure", ...READ_ONLY4 },
8334
+ annotations: { title: "Look up a pipeline", ...READ_ONLY4 },
8293
8335
  _meta: widgetToolMeta("getSpec")
8294
8336
  },
8295
8337
  async (args) => handleGetSpec(getToken, baseUrl, args)
@@ -8515,11 +8557,11 @@ function registerRunTools(server, getToken, baseUrl) {
8515
8557
  server.registerTool(
8516
8558
  "talonic_run_spec",
8517
8559
  {
8518
- title: "Run a Spec pipeline",
8560
+ title: "Run a pipeline",
8519
8561
  description: RUN_DESCRIPTION2,
8520
8562
  inputSchema: runSpecInputSchema,
8521
8563
  annotations: {
8522
- title: "Run a Spec pipeline",
8564
+ title: "Run a pipeline",
8523
8565
  readOnlyHint: false,
8524
8566
  destructiveHint: false,
8525
8567
  openWorldHint: true
@@ -8531,10 +8573,10 @@ function registerRunTools(server, getToken, baseUrl) {
8531
8573
  server.registerTool(
8532
8574
  "talonic_get_run",
8533
8575
  {
8534
- title: "Poll a Spec run",
8576
+ title: "Check run progress",
8535
8577
  description: GET_RUN_DESCRIPTION,
8536
8578
  inputSchema: runRefInputSchema,
8537
- annotations: { title: "Poll a Spec run", ...READ_ONLY5 },
8579
+ annotations: { title: "Check run progress", ...READ_ONLY5 },
8538
8580
  _meta: widgetToolMeta("getRun")
8539
8581
  },
8540
8582
  async (args) => handleGetRun(getToken, baseUrl, args)
@@ -8542,10 +8584,10 @@ function registerRunTools(server, getToken, baseUrl) {
8542
8584
  server.registerTool(
8543
8585
  "talonic_get_run_results",
8544
8586
  {
8545
- title: "Read a Spec run's rows",
8587
+ title: "Read run results",
8546
8588
  description: RESULTS_DESCRIPTION,
8547
8589
  inputSchema: resultsInputSchema,
8548
- annotations: { title: "Read a Spec run's rows", ...READ_ONLY5 },
8590
+ annotations: { title: "Read run results", ...READ_ONLY5 },
8549
8591
  _meta: widgetToolMeta("getRunResults")
8550
8592
  },
8551
8593
  async (args) => handleGetRunResults(getToken, baseUrl, args)
@@ -8558,7 +8600,7 @@ var POLL_HINT = "still processing \u2014 call talonic_get_answer with this ask_i
8558
8600
  var ASK_DESCRIPTION = [
8559
8601
  "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.",
8560
8602
  "",
8561
- "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.",
8603
+ "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.",
8562
8604
  "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).",
8563
8605
  "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).",
8564
8606
  "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."
@@ -8658,11 +8700,11 @@ function registerAskTools(server, getToken, baseUrl) {
8658
8700
  server.registerTool(
8659
8701
  "talonic_ask",
8660
8702
  {
8661
- title: "Ask a question over the workspace",
8703
+ title: "Ask your documents",
8662
8704
  description: ASK_DESCRIPTION,
8663
8705
  inputSchema: askInputSchema,
8664
8706
  annotations: {
8665
- title: "Ask a question over the workspace",
8707
+ title: "Ask your documents",
8666
8708
  readOnlyHint: false,
8667
8709
  destructiveHint: false,
8668
8710
  openWorldHint: false
@@ -8674,11 +8716,11 @@ function registerAskTools(server, getToken, baseUrl) {
8674
8716
  server.registerTool(
8675
8717
  "talonic_get_answer",
8676
8718
  {
8677
- title: "Poll an ask for its answer",
8719
+ title: "Get the answer",
8678
8720
  description: GET_ANSWER_DESCRIPTION,
8679
8721
  inputSchema: { ask_id: uuid2.describe("From talonic_ask.") },
8680
8722
  annotations: {
8681
- title: "Poll an ask for its answer",
8723
+ title: "Get the answer",
8682
8724
  readOnlyHint: true,
8683
8725
  destructiveHint: false,
8684
8726
  idempotentHint: true,
@@ -8692,7 +8734,7 @@ function registerAskTools(server, getToken, baseUrl) {
8692
8734
 
8693
8735
  // package.json
8694
8736
  var package_default = {
8695
- version: "0.1.96"};
8737
+ version: "0.1.98"};
8696
8738
 
8697
8739
  // src/version.ts
8698
8740
  var VERSION = package_default.version;
@@ -8717,6 +8759,9 @@ function buildServerInstructions(opts) {
8717
8759
  "schema-validated JSON with per-field confidence scores and source provenance, and",
8718
8760
  "answers questions about the documents in the user's Talonic workspace.",
8719
8761
  "Which tool for which question:",
8762
+ "(0) any question about what the documents contain (counts, totals, duplicates,",
8763
+ "comparisons, anomalies) -> talonic_ask FIRST, in one call; do not explore fields,",
8764
+ "schemas, specs or SQL to answer it yourself;",
8720
8765
  "(1) a document by name or keyword -> talonic_search (literal keywords: one short term",
8721
8766
  "or an exact filename; on an empty result retry with a shorter keyword), then use the",
8722
8767
  "returned document_id;",