@voxslopuli/teamdynamix-mcp 0.5.4 → 0.5.6

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/index.js CHANGED
@@ -15,7 +15,7 @@ var init_package = __esm({
15
15
  "package.json"() {
16
16
  package_default = {
17
17
  name: "@voxslopuli/teamdynamix-mcp",
18
- version: "0.5.4",
18
+ version: "0.5.6",
19
19
  private: false,
20
20
  description: "A production-ready TypeScript MCP server for TeamDynamix",
21
21
  keywords: [
@@ -61,7 +61,7 @@ var init_package = __esm({
61
61
  },
62
62
  dependencies: {
63
63
  "@modelcontextprotocol/sdk": "^1.30.0",
64
- "@voxslopuli/teamdynamix-ts": "^0.3.1",
64
+ "@voxslopuli/teamdynamix-ts": "^0.3.2",
65
65
  tablemark: "^4.1.0",
66
66
  zod: "^4.6.2"
67
67
  },
@@ -285,8 +285,13 @@ function buildSdkConfig(config, tenant, tokenProvider) {
285
285
  environment: config.baseUrl?.includes("sandbox") ? "sandbox" : "production",
286
286
  baseUrl: config.baseUrl,
287
287
  timeoutMs: config.timeoutMs,
288
- runtimeValidationMode: "fail-open",
289
288
  ...resolveSdkSpecPath() ? { specPath: resolveSdkSpecPath() } : {},
289
+ // The MCP validates its own tool inputs at the boundary (zod schemas); the
290
+ // live API's published schemas don't consistently match its real responses
291
+ // (required-field drift, duplicate enum aliases), so OpenAPI runtime
292
+ // validation runs open here — hard validation against the doc would reject
293
+ // legitimate responses (issue #22 symptom 2).
294
+ runtimeValidationMode: "fail-open",
290
295
  retryPolicy: {
291
296
  maxRetries: config.maxRetries
292
297
  }
@@ -405,21 +410,24 @@ var init_client_factory = __esm({
405
410
  }
406
411
  searchTickets(appId, body) {
407
412
  return this.sdk().then(async (s) => {
408
- const { data, error } = await s.tickets.appIdTicketsSearch({
413
+ const payload = await s.tickets.appIdTicketsSearch({
409
414
  params: { path: { appId } },
410
415
  body: mapTicketSearchBody(body)
411
416
  });
412
- if (error) {
413
- throw new Error(`Ticket search failed: ${JSON.stringify(error)}`);
414
- }
415
- const results = Array.isArray(data) ? data : [];
417
+ const results = Array.isArray(payload) ? payload : [];
416
418
  const groupFilter = parseIdListEnv(process.env["TEAMDYNAMIX_TICKET_GROUP_IDS"]);
417
419
  if (groupFilter.length === 0) return results;
418
- return results.filter((item) => {
420
+ const filtered = results.filter((item) => {
419
421
  if (typeof item !== "object" || item === null) return false;
420
422
  const gid = Number(item["ResponsibleGroupID"]);
421
423
  return groupFilter.includes(gid);
422
424
  });
425
+ if (filtered.length < results.length) {
426
+ console.error(
427
+ `[teamdynamix-mcp] TEAMDYNAMIX_TICKET_GROUP_IDS=${groupFilter.join(",")} filtered ${results.length - filtered.length} of ${results.length} rows for app ${appId}`
428
+ );
429
+ }
430
+ return filtered;
423
431
  });
424
432
  }
425
433
  listTicketTypes(appId) {
@@ -528,14 +536,11 @@ var init_client_factory = __esm({
528
536
  }
529
537
  searchKbArticles(appId, body) {
530
538
  return this.sdk().then(async (s) => {
531
- const { data, error } = await s.knowledgeBase.appIdKnowledgebaseSearch({
539
+ const payload = await s.knowledgeBase.appIdKnowledgebaseSearch({
532
540
  params: { path: { appId } },
533
541
  body: sanitizeTo(body, ARTICLE_SEARCH_KEYS)
534
542
  });
535
- if (error) {
536
- throw new Error(`KB search failed: ${JSON.stringify(error)}`);
537
- }
538
- return Array.isArray(data) ? data : [];
543
+ return Array.isArray(payload) ? payload : [];
539
544
  });
540
545
  }
541
546
  listKbCategories(appId) {