@talonic/mcp 0.1.58 → 0.1.60

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.
@@ -948,6 +948,8 @@ var DESCRIPTION2 = [
948
948
  "- is_empty: presence check, no value needed. Returns documents where the field is null or missing.",
949
949
  "- is_not_empty: presence check, no value needed. Returns documents where the field has a materialized value. Results reflect data within seconds of extraction completing.",
950
950
  "",
951
+ "CONDITION SHAPE: each condition needs EXACTLY ONE of `field` or `field_id` (not both, not neither), an `operator`, and usually a `value`. Exceptions: `is_empty` / `is_not_empty` take NO value; `between` needs BOTH `value` (lower bound) and `value_to` (upper bound). `value`/`value_to` are a string, number, or boolean matching the field's data type (numbers for numeric fields, ISO 'YYYY-MM-DD' strings for dates).",
952
+ "",
951
953
  "SCHEMA TYPING:",
952
954
  "- Numeric operators (`gt`, `gte`, `lt`, `lte`, `between`) only resolve correctly when the schema field is typed as `number`. A field typed as `string` that holds numeric content (e.g. '\u20AC1,500.00') will silently return zero matches even after extraction. Pick the right type at schema design time.",
953
955
  "- **Preventive check:** call `talonic_search` first and inspect `fieldMatches[].dataType` / `fields[].dataType` on the field you intend to filter. If `dataType !== 'number'`, do NOT use a numeric operator on it \u2014 either pick a different field, switch to a string-friendly operator (`eq`, `contains`), or warn the user that the schema field needs a `data_type` change before the filter can succeed.",
@@ -973,14 +975,21 @@ var operatorEnum = z.enum([
973
975
  "is_empty",
974
976
  "is_not_empty"
975
977
  ]);
978
+ var conditionValue = z.union([z.string(), z.number(), z.boolean()]);
976
979
  var conditionSchema = z.object({
977
980
  field: z.string().optional().describe(
978
- "Canonical field name (e.g. 'vendor.name', 'policy.0_coverage_type'). The Talonic API resolves names to ids server-side. Mutually exclusive with `field_id`."
981
+ "Canonical field name (e.g. 'vendor.name', 'policy.0_coverage_type'). Provide EXACTLY ONE of `field` or `field_id` per condition \u2014 not both, not neither. The Talonic API resolves names to ids server-side."
982
+ ),
983
+ field_id: z.string().optional().describe(
984
+ "Talonic field UUID. Provide EXACTLY ONE of `field` or `field_id` per condition \u2014 not both, not neither."
979
985
  ),
980
- field_id: z.string().optional().describe("Talonic field UUID. Mutually exclusive with `field`."),
981
986
  operator: operatorEnum.describe("Comparison operator. See description for the full list."),
982
- value: z.unknown().optional().describe("Value to compare against."),
983
- value_to: z.unknown().optional().describe("Upper bound for `between` operator; ignored otherwise.")
987
+ value: conditionValue.optional().describe(
988
+ "Comparison value, typed to match the field (number for numeric fields, string for text and ISO 'YYYY-MM-DD' dates, boolean for flags). REQUIRED for every operator EXCEPT `is_empty` / `is_not_empty` (which take no value). For `between`, this is the lower bound \u2014 pair it with `value_to`."
989
+ ),
990
+ value_to: conditionValue.optional().describe(
991
+ "Upper bound. REQUIRED only for the `between` operator (paired with `value`); same type as `value`. Omit for all other operators."
992
+ )
984
993
  });
985
994
  var sortSchema = z.object({
986
995
  field: z.string().optional(),
@@ -1752,7 +1761,7 @@ function registerToMarkdown(server, getTalonic) {
1752
1761
 
1753
1762
  // package.json
1754
1763
  var package_default = {
1755
- version: "0.1.58"};
1764
+ version: "0.1.60"};
1756
1765
 
1757
1766
  // src/version.ts
1758
1767
  var VERSION = package_default.version;
@@ -1857,6 +1866,7 @@ var FAVICON_BYTES = Buffer.from(FAVICON_BASE64, "base64");
1857
1866
  var PORT = Number(process.env["PORT"] ?? 3e3);
1858
1867
  var RESOURCE_URL = process.env["MCP_RESOURCE_URL"] ?? "https://mcp.talonic.com";
1859
1868
  var AUTHORIZATION_SERVER = process.env["OAUTH_AUTHORIZATION_SERVER"] ?? "https://api.talonic.com";
1869
+ var APPS_CHALLENGE_TOKEN = process.env["OPENAI_APPS_CHALLENGE_TOKEN"] ?? "gnHvYDsKH6NV8NIeDkVK1vSt5QKZqsg8AIcXdS1pR_U";
1860
1870
  function renderProtectedResourceMetadata() {
1861
1871
  return {
1862
1872
  resource: RESOURCE_URL,
@@ -1927,6 +1937,14 @@ function createRequestHandler() {
1927
1937
  res.end(JSON.stringify(renderProtectedResourceMetadata()));
1928
1938
  return;
1929
1939
  }
1940
+ if (path === "/.well-known/openai-apps-challenge") {
1941
+ res.writeHead(200, {
1942
+ "Content-Type": "text/plain; charset=utf-8",
1943
+ "Cache-Control": "public, max-age=300"
1944
+ });
1945
+ res.end(APPS_CHALLENGE_TOKEN);
1946
+ return;
1947
+ }
1930
1948
  if (path === "/" && req.method === "GET") {
1931
1949
  const accept = String(req.headers["accept"] ?? "");
1932
1950
  if (!accept.includes("text/event-stream")) {