@talonic/mcp 0.1.94 → 0.1.95

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.
@@ -3030,7 +3030,7 @@ async function growthGet(getToken, baseUrl, path, params) {
3030
3030
  if (res.status === 403) {
3031
3031
  return toolError(
3032
3032
  new Error(
3033
- "Talonic growth analytics require an active superadmin account. Sign in to the connector with your Talonic staff account (or use a superadmin-created API key)."
3033
+ "Talonic growth analytics require a superadmin or growth-reader account. Sign in to the connector with your Talonic staff account (or use an API key created by one)."
3034
3034
  )
3035
3035
  );
3036
3036
  }
@@ -3103,6 +3103,82 @@ var toolsUsageInput = {
3103
3103
  source: z.string().optional().describe("Restrict to an acquisition source (UTM value or referrer host)."),
3104
3104
  funnel_stage: z.enum(["attempted", "succeeded", "downloaded", "cta"]).optional().describe("Keep only tools with at least one event at this funnel stage.")
3105
3105
  };
3106
+ var pageArgs = {
3107
+ limit: z.number().int().min(1).max(500).optional().describe("Rows per page (default 100, max 500)."),
3108
+ offset: z.number().int().min(0).optional().describe("Rows to skip, for paging.")
3109
+ };
3110
+ var ATTRIBUTION_DESCRIPTION = [
3111
+ "Read where conversions come from: per landing page or per source, the page views, website conversions",
3112
+ "(total and per event, e.g. lead_submitted, demo_booked), signups and activated signups.",
3113
+ "",
3114
+ "USE WHEN: asked which landing pages or sources produce leads, demo bookings or signups.",
3115
+ "INTERNAL: Talonic growth data; other accounts are rejected by the platform.",
3116
+ "ARGS: range (optional: 7d | 30d | 90d, default 30d), by (optional: landing_page | source, default landing_page).",
3117
+ "RETURNS: { rangeDays, by, rows[] } with each row { key, page_views, conversions, by_event, signups, activated }. Page views are anonymous event counts, conversions and signups are people: three independent totals, not a per-visitor funnel. Signups without stored attribution fall under '(unknown)'."
3118
+ ].join("\n");
3119
+ var EVENTS_DESCRIPTION = [
3120
+ "List identified website conversions (any event the website sent with an email: lead forms, demo bookings, ...),",
3121
+ "newest first, with landing page, UTM tags, referrer and the event's own properties.",
3122
+ "",
3123
+ "USE WHEN: asked who converted, to check that a new website event arrives, or to inspect one person's conversions.",
3124
+ "INTERNAL: Talonic growth data, contains personal data (emails); other accounts are rejected by the platform.",
3125
+ "ARGS: all optional: range (7d | 30d | 90d, default all time), event (exact name), email, source (UTM source or referrer host), limit, offset.",
3126
+ "RETURNS: { events[], total, limit, offset }; hubspot_synced_at is null until the row reached HubSpot."
3127
+ ].join("\n");
3128
+ var SIGNUPS_DESCRIPTION = [
3129
+ "List platform signups, newest first: email, signup method, organisation, where they came from",
3130
+ "(acquisition + acquisition_origin: 'signup' = stored at signup, 'lead' = inherited from an earlier website conversion) and usage so far.",
3131
+ "",
3132
+ "USE WHEN: asked who signed up, from which source or landing page, or what a signup did afterwards.",
3133
+ "INTERNAL: Talonic growth data, contains personal data (emails); other accounts are rejected by the platform.",
3134
+ "ARGS: all optional: range (7d | 30d | 90d, default all time), limit, offset.",
3135
+ "RETURNS: { signups[], total, limit, offset }. private:true marks a personal (non-company) signup; documents and credits_used are per user for those only, company usage lives in talonic_growth_accounts."
3136
+ ].join("\n");
3137
+ var ACCOUNTS_DESCRIPTION = [
3138
+ "List usage per organisation, newest first: users, last login, documents (total and last 30 days),",
3139
+ "API calls and credits (last 30 days), plan, status, and where its first user came from.",
3140
+ "",
3141
+ "USE WHEN: asked how much an organisation uses Talonic, which accounts are active, or usage by acquisition source.",
3142
+ "INTERNAL: Talonic growth data; other accounts are rejected by the platform.",
3143
+ "ARGS: limit, offset (both optional).",
3144
+ "RETURNS: { accounts[], total, limit, offset }. Personal signups are not organisations; they are in talonic_growth_signups."
3145
+ ].join("\n");
3146
+ var page = (a) => ({ limit: a.limit?.toString(), offset: a.offset?.toString() });
3147
+ async function handleGrowthAttribution(getToken, baseUrl, args) {
3148
+ return growthGet(getToken, baseUrl, "attribution", { range: args.range, by: args.by });
3149
+ }
3150
+ async function handleGrowthEvents(getToken, baseUrl, args) {
3151
+ return growthGet(getToken, baseUrl, "events", {
3152
+ range: args.range,
3153
+ event: args.event,
3154
+ email: args.email,
3155
+ source: args.source,
3156
+ ...page(args)
3157
+ });
3158
+ }
3159
+ async function handleGrowthSignups(getToken, baseUrl, args) {
3160
+ return growthGet(getToken, baseUrl, "signups", { range: args.range, ...page(args) });
3161
+ }
3162
+ async function handleGrowthAccounts(getToken, baseUrl, args) {
3163
+ return growthGet(getToken, baseUrl, "accounts", page(args));
3164
+ }
3165
+ var SITE_EVENTS_DESCRIPTION = [
3166
+ "Count anonymous website events (page views, CTA clicks, and any custom event the website sends, e.g. a calculator",
3167
+ "interaction), grouped by one dimension.",
3168
+ "",
3169
+ "USE WHEN: asked which website events exist, how often a custom event fired, or how one splits by page, source or one of its own properties.",
3170
+ "INTERNAL: Talonic growth data; other accounts are rejected by the platform.",
3171
+ "ARGS: all optional: range (7d | 30d | 90d, default 30d), event (exact name), page (exact path), by (event | page | landing_page | source | country | device | prop:<key>, default event). prop:<key> groups by a property the website attached to the event.",
3172
+ "RETURNS: { rangeDays, by, rows[] } with each row { key, count, first_seen, last_seen }. Event counts, never visitors: anonymous events carry no visitor identity."
3173
+ ].join("\n");
3174
+ async function handleGrowthSiteEvents(getToken, baseUrl, args) {
3175
+ return growthGet(getToken, baseUrl, "site-events", {
3176
+ range: args.range,
3177
+ event: args.event,
3178
+ page: args.page,
3179
+ by: args.by
3180
+ });
3181
+ }
3106
3182
  async function handleGrowthFunnel(getToken, baseUrl, args) {
3107
3183
  return growthGet(getToken, baseUrl, "funnel", { range: args.range });
3108
3184
  }
@@ -3169,6 +3245,75 @@ function registerGrowthTools(server, getToken, baseUrl) {
3169
3245
  },
3170
3246
  async (args) => handleGrowthToolsUsage(getToken, baseUrl, args)
3171
3247
  );
3248
+ server.registerTool(
3249
+ "talonic_growth_attribution",
3250
+ {
3251
+ title: "Growth: Attribution",
3252
+ description: ATTRIBUTION_DESCRIPTION,
3253
+ inputSchema: {
3254
+ range: rangeArg,
3255
+ by: z.enum(["landing_page", "source"]).optional().describe("Group by (default landing_page).")
3256
+ },
3257
+ annotations: { title: "Growth: Attribution", ...READ_ONLY }
3258
+ },
3259
+ async (args) => handleGrowthAttribution(getToken, baseUrl, args)
3260
+ );
3261
+ server.registerTool(
3262
+ "talonic_growth_events",
3263
+ {
3264
+ title: "Growth: Website Conversions",
3265
+ description: EVENTS_DESCRIPTION,
3266
+ inputSchema: {
3267
+ range: z.enum(RANGES).optional().describe("Trailing window (default all time)."),
3268
+ event: z.string().optional().describe("Exact event name, e.g. 'lead_submitted'."),
3269
+ email: z.string().optional().describe("One person's conversions."),
3270
+ source: z.string().optional().describe("UTM source or referrer host."),
3271
+ ...pageArgs
3272
+ },
3273
+ annotations: { title: "Growth: Website Conversions", ...READ_ONLY }
3274
+ },
3275
+ async (args) => handleGrowthEvents(getToken, baseUrl, args)
3276
+ );
3277
+ server.registerTool(
3278
+ "talonic_growth_signups",
3279
+ {
3280
+ title: "Growth: Signups",
3281
+ description: SIGNUPS_DESCRIPTION,
3282
+ inputSchema: {
3283
+ range: z.enum(RANGES).optional().describe("Trailing window (default all time)."),
3284
+ ...pageArgs
3285
+ },
3286
+ annotations: { title: "Growth: Signups", ...READ_ONLY }
3287
+ },
3288
+ async (args) => handleGrowthSignups(getToken, baseUrl, args)
3289
+ );
3290
+ server.registerTool(
3291
+ "talonic_growth_accounts",
3292
+ {
3293
+ title: "Growth: Account Usage",
3294
+ description: ACCOUNTS_DESCRIPTION,
3295
+ inputSchema: pageArgs,
3296
+ annotations: { title: "Growth: Account Usage", ...READ_ONLY }
3297
+ },
3298
+ async (args) => handleGrowthAccounts(getToken, baseUrl, args)
3299
+ );
3300
+ server.registerTool(
3301
+ "talonic_growth_site_events",
3302
+ {
3303
+ title: "Growth: Anonymous Website Events",
3304
+ description: SITE_EVENTS_DESCRIPTION,
3305
+ inputSchema: {
3306
+ range: rangeArg,
3307
+ event: z.string().optional().describe("Exact event name, e.g. 'page_cta_clicked'."),
3308
+ page: z.string().optional().describe("Exact page path, e.g. '/pricing'."),
3309
+ by: z.string().optional().describe(
3310
+ "Group by: event | page | landing_page | source | country | device | prop:<key> (default event)."
3311
+ )
3312
+ },
3313
+ annotations: { title: "Growth: Anonymous Website Events", ...READ_ONLY }
3314
+ },
3315
+ async (args) => handleGrowthSiteEvents(getToken, baseUrl, args)
3316
+ );
3172
3317
  }
3173
3318
  var contractIdArg = z.string().uuid().describe("Contract id (from talonic_contracts_register or talonic_contracts_issues).");
3174
3319
  var rowIdArg = z.string().uuid().describe(
@@ -5198,7 +5343,86 @@ var readOnly5 = {
5198
5343
  idempotentHint: true,
5199
5344
  openWorldHint: false
5200
5345
  };
5201
- var write5 = (idempotent, destructive = false) => ({
5346
+ var write5 = {
5347
+ readOnlyHint: false,
5348
+ destructiveHint: false,
5349
+ idempotentHint: true,
5350
+ openWorldHint: false
5351
+ };
5352
+ async function probePortfolioAccess(token, baseUrl) {
5353
+ try {
5354
+ const res = await fetch(buildUrl(baseUrl, "/v1/portfolio"), {
5355
+ headers: { Authorization: `Bearer ${token}`, Accept: "application/json" },
5356
+ signal: AbortSignal.timeout(5e3)
5357
+ });
5358
+ return res.ok;
5359
+ } catch {
5360
+ return false;
5361
+ }
5362
+ }
5363
+ var COMPANIES_DESCRIPTION = "List the portfolio companies (accounts) with how many of their documents were read for KPIs and how many conflicts each has. Start here; use the account_id with talonic_portfolio_company.";
5364
+ var COMPANY_DESCRIPTION = "One portfolio company's KPI table: rows are KPIs (cARR, ARR, revenue, gross margin, EBITDA, net burn, cash, runway, headcount, customers), columns are periods (newest first). Each cell carries the value shown, its basis (actual, restated, draft), the source document with page or sheet locator and a verbatim quote, and every other document's differing value. Cite the source filename and locator when you report a number.";
5365
+ var CONFLICTS_DESCRIPTION = "Every conflict across all portfolio companies: the same KPI for the same period reported with different values by different documents. Each conflict lists the distinct values, the documents stating each (filename, locator, quote) and a one-line explanation (restatement, draft vs final, or unexplained: ask the company). Use this for 'where does my portfolio contradict itself'.";
5366
+ var REFRESH_DESCRIPTION = "Read new or changed documents for KPIs (runs in the background, takes minutes, uses credits). Call only when the user asks to include new documents; then poll talonic_portfolio_companies until documents_read catches up.";
5367
+ function registerPortfolioTools(server, getToken, baseUrl) {
5368
+ const tools = [
5369
+ [
5370
+ "talonic_portfolio_companies",
5371
+ "Portfolio companies",
5372
+ COMPANIES_DESCRIPTION,
5373
+ {},
5374
+ readOnly5,
5375
+ () => runTool(() => apiJson(getToken, baseUrl, "GET", "/v1/portfolio"))
5376
+ ],
5377
+ [
5378
+ "talonic_portfolio_company",
5379
+ "Portfolio company KPI table",
5380
+ COMPANY_DESCRIPTION,
5381
+ {
5382
+ account_id: z.string().uuid().describe("The company's account_id from talonic_portfolio_companies")
5383
+ },
5384
+ readOnly5,
5385
+ (a) => runTool(
5386
+ () => apiJson(
5387
+ getToken,
5388
+ baseUrl,
5389
+ "GET",
5390
+ `/v1/portfolio/companies/${encodeURIComponent(a.account_id)}`
5391
+ )
5392
+ )
5393
+ ],
5394
+ [
5395
+ "talonic_portfolio_conflicts",
5396
+ "Portfolio conflicts",
5397
+ CONFLICTS_DESCRIPTION,
5398
+ {},
5399
+ readOnly5,
5400
+ () => runTool(() => apiJson(getToken, baseUrl, "GET", "/v1/portfolio/conflicts"))
5401
+ ],
5402
+ [
5403
+ "talonic_portfolio_refresh",
5404
+ "Read new portfolio documents",
5405
+ REFRESH_DESCRIPTION,
5406
+ {},
5407
+ write5,
5408
+ () => runTool(() => apiJson(getToken, baseUrl, "POST", "/v1/portfolio/refresh"))
5409
+ ]
5410
+ ];
5411
+ for (const [name, title, description, inputSchema11, annotations, handler] of tools) {
5412
+ server.registerTool(
5413
+ name,
5414
+ { title, description, inputSchema: inputSchema11, annotations: { title, ...annotations } },
5415
+ async (args) => handler(args)
5416
+ );
5417
+ }
5418
+ }
5419
+ var readOnly6 = {
5420
+ readOnlyHint: true,
5421
+ destructiveHint: false,
5422
+ idempotentHint: true,
5423
+ openWorldHint: false
5424
+ };
5425
+ var write6 = (idempotent, destructive = false) => ({
5202
5426
  readOnlyHint: false,
5203
5427
  destructiveHint: destructive,
5204
5428
  idempotentHint: idempotent,
@@ -5365,7 +5589,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
5365
5589
  "Read the Master Records configuration",
5366
5590
  CONFIG_DESCRIPTION2,
5367
5591
  {},
5368
- readOnly5,
5592
+ readOnly6,
5369
5593
  () => handleConfig2(getToken, baseUrl)
5370
5594
  ],
5371
5595
  [
@@ -5373,7 +5597,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
5373
5597
  "Save the Master Records configuration",
5374
5598
  SAVE_CONFIG_DESCRIPTION2,
5375
5599
  saveConfigInputSchema2,
5376
- write5(true, true),
5600
+ write6(true, true),
5377
5601
  (a) => handleSaveConfig2(getToken, baseUrl, a)
5378
5602
  ],
5379
5603
  [
@@ -5381,7 +5605,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
5381
5605
  "Resolve master records",
5382
5606
  RUN_DESCRIPTION,
5383
5607
  runInputSchema,
5384
- write5(true),
5608
+ write6(true),
5385
5609
  (a) => handleRun(getToken, baseUrl, a)
5386
5610
  ],
5387
5611
  [
@@ -5389,7 +5613,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
5389
5613
  "Master records overview",
5390
5614
  OVERVIEW_DESCRIPTION2,
5391
5615
  overviewInputSchema,
5392
- readOnly5,
5616
+ readOnly6,
5393
5617
  (a) => handleOverview2(getToken, baseUrl, a)
5394
5618
  ],
5395
5619
  [
@@ -5397,7 +5621,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
5397
5621
  "One golden record",
5398
5622
  RECORD_DESCRIPTION,
5399
5623
  recordInputSchema,
5400
- readOnly5,
5624
+ readOnly6,
5401
5625
  (a) => handleGetRecord(getToken, baseUrl, a)
5402
5626
  ],
5403
5627
  [
@@ -5405,7 +5629,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
5405
5629
  "Accept or split a golden record",
5406
5630
  DECIDE_DESCRIPTION2,
5407
5631
  decideInputSchema2,
5408
- write5(true),
5632
+ write6(true),
5409
5633
  (a) => handleDecide2(getToken, baseUrl, a)
5410
5634
  ],
5411
5635
  [
@@ -5413,7 +5637,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
5413
5637
  "Master data changes checked against documents",
5414
5638
  CHANGES_DESCRIPTION,
5415
5639
  changesInputSchema,
5416
- readOnly5,
5640
+ readOnly6,
5417
5641
  (a) => handleChanges(getToken, baseUrl, a)
5418
5642
  ],
5419
5643
  [
@@ -5421,7 +5645,7 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
5421
5645
  "Source id to golden record crosswalk",
5422
5646
  CROSSWALK_DESCRIPTION,
5423
5647
  crosswalkInputSchema,
5424
- readOnly5,
5648
+ readOnly6,
5425
5649
  (a) => handleCrosswalk(getToken, baseUrl, a)
5426
5650
  ]
5427
5651
  ];
@@ -5433,13 +5657,13 @@ function registerMasterRecordsTools(server, getToken, baseUrl) {
5433
5657
  );
5434
5658
  }
5435
5659
  }
5436
- var readOnly6 = {
5660
+ var readOnly7 = {
5437
5661
  readOnlyHint: true,
5438
5662
  destructiveHint: false,
5439
5663
  idempotentHint: true,
5440
5664
  openWorldHint: false
5441
5665
  };
5442
- var write6 = (idempotent, destructive = false) => ({
5666
+ var write7 = (idempotent, destructive = false) => ({
5443
5667
  readOnlyHint: false,
5444
5668
  destructiveHint: destructive,
5445
5669
  idempotentHint: idempotent,
@@ -5694,7 +5918,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
5694
5918
  "Submission target structures",
5695
5919
  SPECS_DESCRIPTION,
5696
5920
  {},
5697
- readOnly6,
5921
+ readOnly7,
5698
5922
  () => handleSpecs(getToken, baseUrl)
5699
5923
  ],
5700
5924
  [
@@ -5702,7 +5926,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
5702
5926
  "Submissions inbox",
5703
5927
  LIST_DESCRIPTION2,
5704
5928
  listInputSchema,
5705
- readOnly6,
5929
+ readOnly7,
5706
5930
  (a) => handleList(getToken, baseUrl, a)
5707
5931
  ],
5708
5932
  [
@@ -5710,7 +5934,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
5710
5934
  "Submissions worklist",
5711
5935
  ISSUES_DESCRIPTION5,
5712
5936
  issuesInputSchema3,
5713
- readOnly6,
5937
+ readOnly7,
5714
5938
  (a) => handleIssues5(getToken, baseUrl, a)
5715
5939
  ],
5716
5940
  [
@@ -5718,7 +5942,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
5718
5942
  "Capture and map submissions",
5719
5943
  PROCESS_DESCRIPTION2,
5720
5944
  processInputSchema2,
5721
- write6(true),
5945
+ write7(true),
5722
5946
  (a) => handleProcess2(getToken, baseUrl, a)
5723
5947
  ],
5724
5948
  [
@@ -5726,7 +5950,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
5726
5950
  "Submission completeness",
5727
5951
  COMPLETENESS_DESCRIPTION,
5728
5952
  completenessInputSchema,
5729
- readOnly6,
5953
+ readOnly7,
5730
5954
  (a) => handleCompleteness(getToken, baseUrl, a)
5731
5955
  ],
5732
5956
  [
@@ -5734,7 +5958,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
5734
5958
  "Submission facts by metric and year",
5735
5959
  MATRIX_DESCRIPTION,
5736
5960
  matrixInputSchema,
5737
- readOnly6,
5961
+ readOnly7,
5738
5962
  (a) => handleMatrix(getToken, baseUrl, a)
5739
5963
  ],
5740
5964
  [
@@ -5742,7 +5966,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
5742
5966
  "Submission figures",
5743
5967
  FACTS_DESCRIPTION,
5744
5968
  factsInputSchema,
5745
- readOnly6,
5969
+ readOnly7,
5746
5970
  (a) => handleFacts(getToken, baseUrl, a)
5747
5971
  ],
5748
5972
  [
@@ -5750,7 +5974,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
5750
5974
  "Submission checks",
5751
5975
  CHECKS_DESCRIPTION,
5752
5976
  checksInputSchema,
5753
- readOnly6,
5977
+ readOnly7,
5754
5978
  (a) => handleChecks(getToken, baseUrl, a)
5755
5979
  ],
5756
5980
  [
@@ -5758,7 +5982,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
5758
5982
  "Review label mappings",
5759
5983
  REVIEW_DESCRIPTION,
5760
5984
  reviewInputSchema,
5761
- write6(true),
5985
+ write7(true),
5762
5986
  (a) => handleReview(getToken, baseUrl, a)
5763
5987
  ],
5764
5988
  [
@@ -5766,7 +5990,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
5766
5990
  "Questions for the client's experts",
5767
5991
  QUESTIONS_DESCRIPTION,
5768
5992
  questionsInputSchema,
5769
- write6(true),
5993
+ write7(true),
5770
5994
  (a) => handleQuestions(getToken, baseUrl, a)
5771
5995
  ],
5772
5996
  [
@@ -5774,7 +5998,7 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
5774
5998
  "Export submission facts",
5775
5999
  EXPORT_DESCRIPTION,
5776
6000
  exportInputSchema,
5777
- readOnly6,
6001
+ readOnly7,
5778
6002
  (a) => handleExport(getToken, baseUrl, a)
5779
6003
  ]
5780
6004
  ];
@@ -5791,7 +6015,7 @@ var INDEX_PERIOD_RE = /^\d{4}(-\d{2}|-Q[1-4]|-H[12])?$/;
5791
6015
  var modelIdArg = z.string().uuid().describe("Price model id (from talonic_price_baseline_models).");
5792
6016
  var fromArg = z.string().regex(MONTH_RE).describe("First month of the evaluation window, `YYYY-MM`.");
5793
6017
  var toArg = z.string().regex(MONTH_RE).describe("Last month of the evaluation window, `YYYY-MM`.");
5794
- var readOnly7 = {
6018
+ var readOnly8 = {
5795
6019
  readOnlyHint: true,
5796
6020
  destructiveHint: false,
5797
6021
  idempotentHint: true,
@@ -6050,7 +6274,7 @@ function handleIndices(getToken, baseUrl, args) {
6050
6274
  }
6051
6275
  return runTool(() => apiJson(getToken, baseUrl, "GET", "/v1/price-baseline/indices"));
6052
6276
  }
6053
- var REFRESH_DESCRIPTION = [
6277
+ var REFRESH_DESCRIPTION2 = [
6054
6278
  "Fetch index values from their publishers: BEHG CO2 price (\xA710 law text), Bundesbank VPI and Erzeugerpreise, Destatis GENESIS tables (needs the platform's GENESIS token).",
6055
6279
  "USE WHEN: talonic_price_baseline_prices reports a missing public index for a specific year range (backfill).",
6056
6280
  "NOT FOR: routine sync of every due series (talonic_price_baseline_sync_series); THE levies or grid tariffs, which have no free feed (talonic_price_baseline_add_index_values).",
@@ -6402,7 +6626,7 @@ async function probePriceBaselineAccess(token, baseUrl) {
6402
6626
  }
6403
6627
  }
6404
6628
  function registerPriceBaselineTools(server, getToken, baseUrl) {
6405
- const write7 = (idempotent) => ({
6629
+ const write8 = (idempotent) => ({
6406
6630
  readOnlyHint: false,
6407
6631
  destructiveHint: false,
6408
6632
  idempotentHint: idempotent,
@@ -6414,7 +6638,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6414
6638
  title: "Find contracts and invoices",
6415
6639
  description: DOCUMENTS_DESCRIPTION,
6416
6640
  inputSchema: documentsInputSchema,
6417
- annotations: readOnly7
6641
+ annotations: readOnly8
6418
6642
  },
6419
6643
  async (args) => handleDocuments(getToken, baseUrl, args)
6420
6644
  );
@@ -6424,7 +6648,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6424
6648
  title: "Build or enrich a price model from a contract",
6425
6649
  description: EXTRACT_DESCRIPTION,
6426
6650
  inputSchema: extractInputSchema,
6427
- annotations: write7(false)
6651
+ annotations: write8(false)
6428
6652
  },
6429
6653
  async (args) => handleExtract2(getToken, baseUrl, args)
6430
6654
  );
@@ -6434,7 +6658,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6434
6658
  title: "List or read price models",
6435
6659
  description: MODELS_DESCRIPTION,
6436
6660
  inputSchema: modelsInputSchema,
6437
- annotations: readOnly7
6661
+ annotations: readOnly8
6438
6662
  },
6439
6663
  async (args) => handleModels(getToken, baseUrl, args)
6440
6664
  );
@@ -6444,7 +6668,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6444
6668
  title: "Edit or confirm a price model",
6445
6669
  description: UPDATE_DESCRIPTION,
6446
6670
  inputSchema: updateInputSchema,
6447
- annotations: write7(true)
6671
+ annotations: write8(true)
6448
6672
  },
6449
6673
  async (args) => handleUpdate(getToken, baseUrl, args)
6450
6674
  );
@@ -6454,7 +6678,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6454
6678
  title: "Recompute contract prices",
6455
6679
  description: PRICES_DESCRIPTION,
6456
6680
  inputSchema: pricesInputSchema,
6457
- annotations: readOnly7
6681
+ annotations: readOnly8
6458
6682
  },
6459
6683
  async (args) => handlePrices(getToken, baseUrl, args)
6460
6684
  );
@@ -6464,7 +6688,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6464
6688
  title: "Download the price baseline workbook",
6465
6689
  description: WORKBOOK_DESCRIPTION,
6466
6690
  inputSchema: workbookInputSchema,
6467
- annotations: readOnly7
6691
+ annotations: readOnly8
6468
6692
  },
6469
6693
  async (args) => handleWorkbook(getToken, baseUrl, args)
6470
6694
  );
@@ -6474,7 +6698,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6474
6698
  title: "Check an invoice against the contract",
6475
6699
  description: COMPARE_DESCRIPTION,
6476
6700
  inputSchema: compareInputSchema,
6477
- annotations: write7(false)
6701
+ annotations: write8(false)
6478
6702
  },
6479
6703
  async (args) => handleCompare(getToken, baseUrl, args)
6480
6704
  );
@@ -6484,7 +6708,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6484
6708
  title: "Audit-proof invoice",
6485
6709
  description: PROOF_INVOICE_DESCRIPTION,
6486
6710
  inputSchema: proofInvoiceInputSchema,
6487
- annotations: readOnly7
6711
+ annotations: readOnly8
6488
6712
  },
6489
6713
  async (args) => handleProofInvoice(getToken, baseUrl, args)
6490
6714
  );
@@ -6494,7 +6718,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6494
6718
  title: "Index catalog and values",
6495
6719
  description: INDICES_DESCRIPTION,
6496
6720
  inputSchema: indicesInputSchema,
6497
- annotations: readOnly7
6721
+ annotations: readOnly8
6498
6722
  },
6499
6723
  async (args) => handleIndices(getToken, baseUrl, args)
6500
6724
  );
@@ -6502,9 +6726,9 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6502
6726
  "talonic_price_baseline_refresh_indices",
6503
6727
  {
6504
6728
  title: "Fetch public index values",
6505
- description: REFRESH_DESCRIPTION,
6729
+ description: REFRESH_DESCRIPTION2,
6506
6730
  inputSchema: refreshInputSchema,
6507
- annotations: { ...write7(true), openWorldHint: true }
6731
+ annotations: { ...write8(true), openWorldHint: true }
6508
6732
  },
6509
6733
  async (args) => handleRefresh(getToken, baseUrl, args)
6510
6734
  );
@@ -6514,7 +6738,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6514
6738
  title: "Enter sourced index values",
6515
6739
  description: MANUAL_DESCRIPTION,
6516
6740
  inputSchema: manualInputSchema,
6517
- annotations: write7(true)
6741
+ annotations: write8(true)
6518
6742
  },
6519
6743
  async (args) => handleManual(getToken, baseUrl, args)
6520
6744
  );
@@ -6524,7 +6748,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6524
6748
  title: "Contract register and expected invoices",
6525
6749
  description: REGISTER_DESCRIPTION2,
6526
6750
  inputSchema: registerInputSchema2,
6527
- annotations: readOnly7
6751
+ annotations: readOnly8
6528
6752
  },
6529
6753
  async (args) => handleRegister2(getToken, baseUrl, args)
6530
6754
  );
@@ -6534,7 +6758,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6534
6758
  title: "Contract workbook and open inputs",
6535
6759
  description: CONTRACT_DESCRIPTION3,
6536
6760
  inputSchema: contractInputSchema3,
6537
- annotations: readOnly7
6761
+ annotations: readOnly8
6538
6762
  },
6539
6763
  async (args) => handleContract3(getToken, baseUrl, args)
6540
6764
  );
@@ -6544,7 +6768,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6544
6768
  title: "Answer an open contract input",
6545
6769
  description: ANSWER_DESCRIPTION,
6546
6770
  inputSchema: answerInputSchema,
6547
- annotations: write7(true)
6771
+ annotations: write8(true)
6548
6772
  },
6549
6773
  async (args) => handleAnswer(getToken, baseUrl, args)
6550
6774
  );
@@ -6554,7 +6778,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6554
6778
  title: "List assumptions",
6555
6779
  description: ASSUMPTIONS_DESCRIPTION,
6556
6780
  inputSchema: assumptionsInputSchema,
6557
- annotations: readOnly7
6781
+ annotations: readOnly8
6558
6782
  },
6559
6783
  async (args) => handleAssumptions(getToken, baseUrl, args)
6560
6784
  );
@@ -6564,7 +6788,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6564
6788
  title: "Make, replace or withdraw an assumption",
6565
6789
  description: ASSUME_DESCRIPTION,
6566
6790
  inputSchema: assumeInputSchema,
6567
- annotations: { ...write7(false), destructiveHint: true }
6791
+ annotations: { ...write8(false), destructiveHint: true }
6568
6792
  },
6569
6793
  async (args) => handleAssume(getToken, baseUrl, args)
6570
6794
  );
@@ -6574,7 +6798,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6574
6798
  title: "Sync external price data",
6575
6799
  description: SYNC_DESCRIPTION,
6576
6800
  inputSchema: syncInputSchema,
6577
- annotations: { ...write7(true), openWorldHint: true }
6801
+ annotations: { ...write8(true), openWorldHint: true }
6578
6802
  },
6579
6803
  async (args) => handleSync(getToken, baseUrl, args)
6580
6804
  );
@@ -6584,7 +6808,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6584
6808
  title: "Import candidates and status",
6585
6809
  description: IMPORTS_DESCRIPTION,
6586
6810
  inputSchema: importsInputSchema,
6587
- annotations: readOnly7
6811
+ annotations: readOnly8
6588
6812
  },
6589
6813
  async (args) => handleImports(getToken, baseUrl, args)
6590
6814
  );
@@ -6594,7 +6818,7 @@ function registerPriceBaselineTools(server, getToken, baseUrl) {
6594
6818
  title: "Import contracts from data capture",
6595
6819
  description: IMPORT_DESCRIPTION2,
6596
6820
  inputSchema: importInputSchema2,
6597
- annotations: write7(true)
6821
+ annotations: write8(true)
6598
6822
  },
6599
6823
  async (args) => handleImport2(getToken, baseUrl, args)
6600
6824
  );
@@ -7450,14 +7674,14 @@ async function handleFieldValues(getToken, baseUrl, args) {
7450
7674
  limit: args.limit,
7451
7675
  cursor: args.cursor
7452
7676
  };
7453
- const page = await apiJson(
7677
+ const page2 = await apiJson(
7454
7678
  getToken,
7455
7679
  baseUrl,
7456
7680
  "GET",
7457
7681
  `/v1/fields/${id}/values`,
7458
7682
  { params }
7459
7683
  );
7460
- return resolution ? { ...page, resolution } : page;
7684
+ return resolution ? { ...page2, resolution } : page2;
7461
7685
  });
7462
7686
  }
7463
7687
  function registerFieldTools(server, getToken, baseUrl) {
@@ -8161,7 +8385,7 @@ function registerAskTools(server, getToken, baseUrl) {
8161
8385
 
8162
8386
  // package.json
8163
8387
  var package_default = {
8164
- version: "0.1.94"};
8388
+ version: "0.1.95"};
8165
8389
 
8166
8390
  // src/version.ts
8167
8391
  var VERSION = package_default.version;
@@ -8329,6 +8553,9 @@ function createServer(options) {
8329
8553
  if (options.includePartiesTools) {
8330
8554
  registerPartiesTools(server, rawToken, baseUrl);
8331
8555
  }
8556
+ if (options.includePortfolioTools) {
8557
+ registerPortfolioTools(server, rawToken, baseUrl);
8558
+ }
8332
8559
  if (options.includeMasterRecordsTools) {
8333
8560
  registerMasterRecordsTools(server, rawToken, baseUrl);
8334
8561
  }
@@ -8425,6 +8652,15 @@ async function docGenAccessCached(token, probe = (t) => probeDocGenAccess(t, pro
8425
8652
  docGenProbeCache.set(token, { ok, expiresAt: now() + GROWTH_PROBE_TTL_MS });
8426
8653
  return ok;
8427
8654
  }
8655
+ var portfolioProbeCache = /* @__PURE__ */ new Map();
8656
+ async function portfolioAccessCached(token, probe = (t) => probePortfolioAccess(t, process.env["TALONIC_BASE_URL"]), now = Date.now) {
8657
+ const hit = portfolioProbeCache.get(token);
8658
+ if (hit && hit.expiresAt > now()) return hit.ok;
8659
+ const ok = await probe(token);
8660
+ if (portfolioProbeCache.size >= 1e3) portfolioProbeCache.clear();
8661
+ portfolioProbeCache.set(token, { ok, expiresAt: now() + GROWTH_PROBE_TTL_MS });
8662
+ return ok;
8663
+ }
8428
8664
  var partiesProbeCache = /* @__PURE__ */ new Map();
8429
8665
  async function partiesAccessCached(token, probe = (t) => probePartiesAccess(t, process.env["TALONIC_BASE_URL"]), now = Date.now) {
8430
8666
  const hit = partiesProbeCache.get(token);
@@ -8747,7 +8983,8 @@ function createRequestHandler(options = {}) {
8747
8983
  includePartiesTools,
8748
8984
  includeMasterRecordsTools,
8749
8985
  includeSubmissionsTools,
8750
- includePriceBaselineTools
8986
+ includePriceBaselineTools,
8987
+ includePortfolioTools
8751
8988
  ] = await Promise.all([
8752
8989
  (options.growthAccess ?? ((currentToken) => growthAccessCached(
8753
8990
  currentToken,
@@ -8767,7 +9004,10 @@ function createRequestHandler(options = {}) {
8767
9004
  ),
8768
9005
  (options.masterRecordsAccess ?? ((currentToken) => masterRecordsAccessCached(currentToken)))(token),
8769
9006
  (options.submissionsAccess ?? ((currentToken) => submissionsAccessCached(currentToken)))(token),
8770
- (options.priceBaselineAccess ?? ((currentToken) => priceBaselineAccessCached(currentToken)))(token)
9007
+ (options.priceBaselineAccess ?? ((currentToken) => priceBaselineAccessCached(currentToken)))(token),
9008
+ (options.portfolioAccess ?? ((currentToken) => portfolioAccessCached(currentToken)))(
9009
+ token
9010
+ )
8771
9011
  ]);
8772
9012
  const mcpServer = createServer({
8773
9013
  tokenProvider: () => token,
@@ -8780,6 +9020,7 @@ function createRequestHandler(options = {}) {
8780
9020
  includeMasterRecordsTools,
8781
9021
  includeSubmissionsTools,
8782
9022
  includePriceBaselineTools,
9023
+ includePortfolioTools,
8783
9024
  ...process.env["TALONIC_BASE_URL"] ? { baseUrl: process.env["TALONIC_BASE_URL"] } : {},
8784
9025
  // Listing UX only: an OAuth token that visibly lacks apps:decide gets
8785
9026
  // the decision-task tools marked non-invocable. The platform decides.
@@ -8827,6 +9068,6 @@ if (isDirectInvocation()) {
8827
9068
  });
8828
9069
  }
8829
9070
 
8830
- export { adminAgentTaskAccessCached, apAccessCached, contractsAccessCached, createRequestHandler, docGenAccessCached, growthAccessCached, isOpenAiClient, masterRecordsAccessCached, partiesAccessCached, priceBaselineAccessCached, submissionsAccessCached, tokenAcceptedCached };
9071
+ export { adminAgentTaskAccessCached, apAccessCached, contractsAccessCached, createRequestHandler, docGenAccessCached, growthAccessCached, isOpenAiClient, masterRecordsAccessCached, partiesAccessCached, portfolioAccessCached, priceBaselineAccessCached, submissionsAccessCached, tokenAcceptedCached };
8831
9072
  //# sourceMappingURL=http-server.js.map
8832
9073
  //# sourceMappingURL=http-server.js.map