@talonic/mcp 0.1.90 → 0.1.91

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
@@ -5312,6 +5312,81 @@ function handleExport(getToken, baseUrl, args) {
5312
5312
  () => apiJson(getToken, baseUrl, "GET", "/v1/submissions/export", { params: args })
5313
5313
  );
5314
5314
  }
5315
+ var MATRIX_DESCRIPTION = [
5316
+ "Where one submission's figures are: facts per metric and year (accident, underwriting or reference period), every metric of the target structure included, grouped into families (premium, losses, exposure, cat, rates, other). Key '' counts facts with no period.",
5317
+ "USE WHEN: seeing what a submission covers before answering a question about it; finding which metric and year to read with talonic_submissions_facts.",
5318
+ "NOT FOR: the figures themselves (talonic_submissions_facts).",
5319
+ "",
5320
+ "ARGS: `document_id`, `spec_id`.",
5321
+ "RETURNS: { years[], rows[] { metric, family, in_format, facts, years { year: count } } }."
5322
+ ].join("\n");
5323
+ var matrixInputSchema = {
5324
+ document_id: z.string().uuid().describe("Submission (workbook document) id."),
5325
+ spec_id: specId
5326
+ };
5327
+ function handleMatrix(getToken, baseUrl, args) {
5328
+ return runTool(
5329
+ () => apiJson(
5330
+ getToken,
5331
+ baseUrl,
5332
+ "GET",
5333
+ `/v1/submissions/${encodeURIComponent(args.document_id)}/matrix`,
5334
+ {
5335
+ params: { spec_id: args.spec_id }
5336
+ }
5337
+ )
5338
+ );
5339
+ }
5340
+ var FACTS_DESCRIPTION = [
5341
+ `One submission's figures, filtered: by metric, by year ('' = no period) and by field values (e.g. { "LoB Client": "Homeowners", "Category": "Cat" }). Each fact carries its fields and the source cell (sheet, A1, and the embedded file when it came from one), so every number can be cited.`,
5342
+ 'USE WHEN: answering a question about figures ("total incurred for accident year 2019", "paid loss by line of business"). Read talonic_submissions_matrix first to pick metric and year. Do not add up facts across lines of business or categories without checking for a Total row: a total and its parts are both facts.',
5343
+ "NOT FOR: every fact of a submission (talonic_submissions_export).",
5344
+ "",
5345
+ "ARGS: `document_id`, `spec_id`, `metric`, `year`, `fields`, `limit` (1\u20131000, default 200), `offset`.",
5346
+ "RETURNS: { total, facts[] { metric, figure, year, fields, source { sheet, a1, embedded }, derived, total } }."
5347
+ ].join("\n");
5348
+ var factsInputSchema = {
5349
+ document_id: z.string().uuid().describe("Submission (workbook document) id."),
5350
+ spec_id: specId,
5351
+ metric: z.string().max(200).optional().describe("Metric name exactly as talonic_submissions_matrix lists it."),
5352
+ year: z.string().regex(/^((19|20)\d{2})?$/).optional().describe("Four-digit year, or '' for facts with no period."),
5353
+ fields: z.record(z.string(), z.string()).optional().describe("Field values every fact must carry."),
5354
+ limit: z.number().int().min(1).max(1e3).optional(),
5355
+ offset: z.number().int().min(0).optional()
5356
+ };
5357
+ function handleFacts(getToken, baseUrl, args) {
5358
+ const { document_id, fields, ...rest } = args;
5359
+ return runTool(
5360
+ () => apiJson(getToken, baseUrl, "GET", `/v1/submissions/${encodeURIComponent(document_id)}/facts`, {
5361
+ params: { ...rest, ...fields ? { fields: JSON.stringify(fields) } : {} }
5362
+ })
5363
+ );
5364
+ }
5365
+ var CHECKS_DESCRIPTION = [
5366
+ "What does not add up in one submission: totals that are not the sum of their rows, cumulative paid amounts that fall, and the target structure's identities (e.g. Total Incurred = Paid Loss + Paid LAE + Outstanding Loss). Each with the cell, the actual and the expected figure.",
5367
+ "USE WHEN: reviewing a submission's quality, or before quoting a figure that a finding concerns.",
5368
+ "NOT FOR: counts across submissions (talonic_submissions_list).",
5369
+ "",
5370
+ "ARGS: `document_id`, `spec_id` (optional; identities need it).",
5371
+ "RETURNS: [{ kind, severity, sheet, a1, embedded, expected, actual, parts[], check }]."
5372
+ ].join("\n");
5373
+ var checksInputSchema = {
5374
+ document_id: z.string().uuid().describe("Submission (workbook document) id."),
5375
+ spec_id: specId.optional()
5376
+ };
5377
+ function handleChecks(getToken, baseUrl, args) {
5378
+ return runTool(
5379
+ () => apiJson(
5380
+ getToken,
5381
+ baseUrl,
5382
+ "GET",
5383
+ `/v1/submissions/${encodeURIComponent(args.document_id)}/checks`,
5384
+ {
5385
+ params: args.spec_id ? { spec_id: args.spec_id } : {}
5386
+ }
5387
+ )
5388
+ );
5389
+ }
5315
5390
  async function probeSubmissionsAccess(token, baseUrl) {
5316
5391
  try {
5317
5392
  const res = await fetch(buildUrl(baseUrl, "/v1/submissions/specs"), {
@@ -5365,6 +5440,30 @@ function registerSubmissionsTools(server, getToken, baseUrl) {
5365
5440
  readOnly6,
5366
5441
  (a) => handleCompleteness(getToken, baseUrl, a)
5367
5442
  ],
5443
+ [
5444
+ "talonic_submissions_matrix",
5445
+ "Submission facts by metric and year",
5446
+ MATRIX_DESCRIPTION,
5447
+ matrixInputSchema,
5448
+ readOnly6,
5449
+ (a) => handleMatrix(getToken, baseUrl, a)
5450
+ ],
5451
+ [
5452
+ "talonic_submissions_facts",
5453
+ "Submission figures",
5454
+ FACTS_DESCRIPTION,
5455
+ factsInputSchema,
5456
+ readOnly6,
5457
+ (a) => handleFacts(getToken, baseUrl, a)
5458
+ ],
5459
+ [
5460
+ "talonic_submissions_checks",
5461
+ "Submission checks",
5462
+ CHECKS_DESCRIPTION,
5463
+ checksInputSchema,
5464
+ readOnly6,
5465
+ (a) => handleChecks(getToken, baseUrl, a)
5466
+ ],
5368
5467
  [
5369
5468
  "talonic_submissions_export",
5370
5469
  "Export submission facts",
@@ -6928,7 +7027,7 @@ function registerAskTools(server, getToken, baseUrl) {
6928
7027
 
6929
7028
  // package.json
6930
7029
  var package_default = {
6931
- version: "0.1.90"};
7030
+ version: "0.1.91"};
6932
7031
 
6933
7032
  // src/version.ts
6934
7033
  var VERSION = package_default.version;