iit-mcp-autotask 0.63.6 → 0.63.8

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/capabilities.json CHANGED
@@ -74,7 +74,7 @@
74
74
  },
75
75
  {
76
76
  "id": "autotask.platform.catalog",
77
- "description": "Find the exact operation key for anything without a dedicated tool: ranked search (q) over the 1,301 registry operations, with effect and whether this deployment serves it. No vendor call.",
77
+ "description": "Find the exact operation key for anything without a dedicated tool: ranked search (q) over the 1,315 registry operations, with effect and whether this deployment serves it. No vendor call.",
78
78
  "mcpPrimitive": "tool",
79
79
  "toolName": "autotask_catalog",
80
80
  "type": "read",
@@ -480,7 +480,7 @@
480
480
  "autotask_describe",
481
481
  "autotask_read"
482
482
  ],
483
- "backingRegistryOperations": 1301,
483
+ "backingRegistryOperations": 1315,
484
484
  "note": "autotask_catalog finds the exact operation key (ranked search), autotask_describe serves its contract, autotask_read runs any effect=read key. Writes go through the operator profile (autotask_write then autotask_apply); authenticate.* is never served."
485
485
  },
486
486
  "schemas": {}
@@ -139,10 +139,14 @@ export function resolveWritePolicy(env) {
139
139
  dedupProblems.push(`${op}: task-level queries can include child attachments and cannot establish exact task-parent duplicates; remove this AUTOTASK_DEDUP entry and use explicit scoped create`);
140
140
  continue;
141
141
  }
142
- if (op === 'task_note_attachments.create') {
142
+ if (op === 'task_note_attachments.create' || op === 'configuration_item_note_attachments.create') {
143
143
  dedupProblems.push(`${op}: the note-filtered query cannot establish exact note-parent duplicates; remove this AUTOTASK_DEDUP entry and use explicit scoped create`);
144
144
  continue;
145
145
  }
146
+ if (op === 'configuration_item_attachments.create') {
147
+ dedupProblems.push(`${op}: the configuration-item query cannot establish exact configuration-item parent duplicates; remove this AUTOTASK_DEDUP entry and use explicit scoped create`);
148
+ continue;
149
+ }
146
150
  if (!fields.every((f) => FIELD.test(f))) {
147
151
  dedupProblems.push(`${op}: each field must be a plain field name joined by +`);
148
152
  continue;
@@ -107,7 +107,7 @@ export declare function sdkCacheOptions(cache: 'on' | 'off'): Pick<AutotaskConfi
107
107
  * fails the boot (or the CI test) instead of quietly shipping a tool surface that no longer
108
108
  * describes the SDK behind it.
109
109
  */
110
- export declare const BUILT_AGAINST_PLAN_HASH = "ad752908bb8c2b868f1df63ba52fd308bd4eaec8e6c9c9182f97504ad79f5ca4";
110
+ export declare const BUILT_AGAINST_PLAN_HASH = "a84c111cf8c415f470fc48dff7ad406f0f67ee9c2a8d75f963e4812e5a2577b2";
111
111
  /**
112
112
  * Fail fast when the installed SDK's plan has moved out from under this surface.
113
113
  * Called at boot (main.ts) and safe to call repeatedly (pure comparison).
@@ -187,7 +187,7 @@ export function sdkCacheOptions(cache) {
187
187
  * fails the boot (or the CI test) instead of quietly shipping a tool surface that no longer
188
188
  * describes the SDK behind it.
189
189
  */
190
- export const BUILT_AGAINST_PLAN_HASH = 'ad752908bb8c2b868f1df63ba52fd308bd4eaec8e6c9c9182f97504ad79f5ca4';
190
+ export const BUILT_AGAINST_PLAN_HASH = 'a84c111cf8c415f470fc48dff7ad406f0f67ee9c2a8d75f963e4812e5a2577b2';
191
191
  /**
192
192
  * Fail fast when the installed SDK's plan has moved out from under this surface.
193
193
  * Called at boot (main.ts) and safe to call repeatedly (pure comparison).
@@ -165,7 +165,7 @@ function evaluatePreview(r, a, snap, dry, resource, types) {
165
165
  const attribution = typeof contact === 'number'
166
166
  ? `Requested contact author ${contact}, subject to Autotask validation${resourceIdentity === undefined ? '' : `. Request uses ${resourceIdentity}`}`
167
167
  : `Creator: ${resourceIdentity ?? 'API user'}`;
168
- const fileAttachment = op === 'task_attachments.create' || op === 'task_note_attachments.create';
168
+ const fileAttachment = ['configuration_item_attachments.create', 'configuration_item_note_attachments.create', 'task_attachments.create', 'task_note_attachments.create'].includes(op);
169
169
  const base64 = fileAttachment && parsed.data?.attachmentType === 'FILE_ATTACHMENT' ? parsed.data.data : undefined;
170
170
  const file = typeof base64 === 'string'
171
171
  ? { bytes: Buffer.byteLength(base64, 'base64'), sha256: createHash('sha256').update(base64, 'base64').digest('hex') }
@@ -58,6 +58,15 @@ export function getIds(ctx, resource, parentId, id) {
58
58
  }
59
59
  class AttachmentScopeUnresolved extends Error {
60
60
  }
61
+ /** AttachmentInfo uses installedProduct names in vendor help and configurationItem names in Swagger. */
62
+ function assetOrigin(attachment, field, documentedField) {
63
+ const swagger = ci(attachment, field);
64
+ const documented = ci(attachment, documentedField);
65
+ if (swagger != null && documented != null && swagger !== documented) {
66
+ throw new AttachmentScopeUnresolved(`attachment_info: conflicting ${field} and ${documentedField} associations`);
67
+ }
68
+ return swagger ?? documented;
69
+ }
61
70
  /** The reader for one snapshot. Only the write's own target record is hashed in full; a referenced record is hashed by its stable facts. */
62
71
  function createReader(ctx, targetKey, signal, operation) {
63
72
  const reads = {};
@@ -65,7 +74,9 @@ function createReader(ctx, targetKey, signal, operation) {
65
74
  const companies = new Set();
66
75
  const unresolved = [];
67
76
  const taskAttachment = operation === 'task_attachments.create' || operation === 'task_attachments.delete';
68
- const strictAttachment = taskAttachment || operation === 'task_note_attachments.create' || operation === 'task_note_attachments.delete';
77
+ const assetAttachment = operation === 'configuration_item_attachments.create' || operation === 'configuration_item_attachments.delete';
78
+ const assetNoteAttachment = operation === 'configuration_item_note_attachments.create' || operation === 'configuration_item_note_attachments.delete';
79
+ const strictAttachment = taskAttachment || assetAttachment || assetNoteAttachment || operation === 'task_note_attachments.create' || operation === 'task_note_attachments.delete';
69
80
  // The write's own TARGET record is hashed in full (an update/delete must notice any change to it);
70
81
  // a record that is only REFERENCED (the ticket a time entry is logged on) is hashed by its stable
71
82
  // facts only, so a volatile stamp the first of two outstanding writes moves (lastActivityDate,
@@ -83,7 +94,7 @@ function createReader(ctx, targetKey, signal, operation) {
83
94
  if (v === undefined)
84
95
  throw new Cancelled();
85
96
  const model = v;
86
- const hasCompanyScope = resource === 'projects' || resource === 'contracts';
97
+ const hasCompanyScope = resource === 'projects' || resource === 'contracts' || ((assetAttachment || assetNoteAttachment) && resource === 'configuration_items');
87
98
  if (strictAttachment && (ci(model, 'id') !== ids.at(-1) || (hasCompanyScope && !isRefId(ci(model, 'companyID'), 'companies')))) {
88
99
  throw new AttachmentScopeUnresolved(`${resource}: the fresh record did not establish the requested identity and scope`);
89
100
  }
@@ -166,6 +177,9 @@ function createReader(ctx, targetKey, signal, operation) {
166
177
  const attachmentOrigin = taskAttachment && !payload && (resource === 'attachment_info' || resource === 'task_attachments');
167
178
  if (attachmentOrigin)
168
179
  refs.push(['taskNoteID', 'task_notes'], ['timeEntryID', 'time_entries']);
180
+ if (assetAttachment && !payload && (resource === 'attachment_info' || resource === 'configuration_item_attachments')) {
181
+ refs.push(['configurationItemNoteID', 'configuration_item_notes']);
182
+ }
169
183
  const children = await drainReads(refs.map(async ([field, res]) => {
170
184
  let read;
171
185
  try {
@@ -357,12 +371,16 @@ export async function takeSnapshot(ctx, record, parsed, duplicateFields, signal)
357
371
  const r = createReader(ctx, targetKey, signal, record.id);
358
372
  const { get, idsFor, anchor, reads, hashed, unresolved, companies } = r;
359
373
  const { targets, data } = parsed;
374
+ const assetNoteAttachment = record.resource === 'configuration_item_note_attachments';
360
375
  const parent = targets.parentId === undefined ? undefined : await parentOf(record.resource);
361
376
  if (writeShape(record) === 'create_child' && parent !== undefined && data !== undefined) {
362
377
  const payloadParent = ci(data, parent.field);
363
378
  if (record.id === 'task_note_attachments.create' && payloadParent !== undefined) {
364
379
  return reason('INPUT_INVALID', 'Pass the task note ID as parentId for a task note attachment', 'data.taskNoteID');
365
380
  }
381
+ if (assetNoteAttachment && payloadParent !== undefined) {
382
+ return reason('INPUT_INVALID', 'Pass the configuration item note ID as parentId for a note attachment', 'data.configurationItemNoteID');
383
+ }
366
384
  if (record.id === 'task_attachments.create' && payloadParent !== undefined && typeof payloadParent !== 'number') {
367
385
  return reason('INPUT_INVALID', `${record.id}: data.${parent.field} must be a numeric task identifier`, `data.${parent.field}`);
368
386
  }
@@ -409,7 +427,8 @@ export async function takeSnapshot(ctx, record, parsed, duplicateFields, signal)
409
427
  if (targetParent !== targets.parentId)
410
428
  return reason('INPUT_INVALID', `${record.id}: the target's ${parent.field} conflicts with the parentId route`, 'args.0');
411
429
  }
412
- await anchor(record.resource, current, 0, false);
430
+ // The note's independent locator lookup below supplies its authoritative asset.
431
+ await anchor(record.resource, current, 0, false, !assetNoteAttachment);
413
432
  }
414
433
  if (targets.toId !== undefined) {
415
434
  // the TARGET ticket is a scope fact of its own (its company joins the union), read live
@@ -423,12 +442,13 @@ export async function takeSnapshot(ctx, record, parsed, duplicateFields, signal)
423
442
  }
424
443
  }
425
444
  if (data !== undefined) {
426
- if (record.id === 'task_attachments.create' && ci(data, 'parentAttachmentID') !== undefined) {
445
+ const nestedAsset = record.id === 'configuration_item_attachments.create';
446
+ if ((nestedAsset || record.id === 'task_attachments.create') && ci(data, 'parentAttachmentID') !== undefined) {
427
447
  const parentAttachmentID = ci(data, 'parentAttachmentID');
428
448
  if (!isRefId(parentAttachmentID, 'attachment_info')) {
429
449
  return reason('INPUT_INVALID', `${record.id}: parentAttachmentID must identify an attachment`, 'data.parentAttachmentID');
430
450
  }
431
- const unproved = reason('TARGET_NOT_IN_SCOPE', `${record.id}: the parent attachment's task scope could not be established`);
451
+ const unproved = reason('TARGET_NOT_IN_SCOPE', `${record.id}: the parent attachment's ${nestedAsset ? 'configuration item' : 'task'} scope could not be established`);
432
452
  let attachment;
433
453
  try {
434
454
  attachment = await get('attachment_info', [parentAttachmentID]);
@@ -438,11 +458,19 @@ export async function takeSnapshot(ctx, record, parsed, duplicateFields, signal)
438
458
  throw err;
439
459
  return unproved;
440
460
  }
441
- if (!isRefId(ci(attachment, 'taskID'), 'tasks') || ci(attachment, 'taskID') !== targets.parentId)
461
+ const parentResource = nestedAsset ? 'configuration_items' : 'tasks';
462
+ const owner = nestedAsset ? assetOrigin(attachment, 'configurationItemID', 'installedProductID') : ci(attachment, 'taskID');
463
+ if (!isRefId(owner, parentResource) || owner !== targets.parentId)
442
464
  return unproved;
465
+ const scoped = nestedAsset ? {
466
+ ...attachment,
467
+ configurationItemID: owner,
468
+ configurationItemNoteID: assetOrigin(attachment, 'configurationItemNoteID', 'installedProductNoteID'),
469
+ } : attachment;
443
470
  // The ancestor and origin fields also bind the proposed attachment relationship to this preview.
444
- hashed[`attachment_info:${parentAttachmentID}:origin`] = ['parentAttachmentID', 'taskNoteID', 'timeEntryID'].map(field => ci(attachment, field));
445
- await anchor('attachment_info', attachment, 0, false);
471
+ const originFields = nestedAsset ? ['parentAttachmentID', 'configurationItemID', 'configurationItemNoteID'] : ['parentAttachmentID', 'taskNoteID', 'timeEntryID'];
472
+ hashed[`attachment_info:${parentAttachmentID}:origin`] = originFields.map(field => ci(scoped, field));
473
+ await anchor('attachment_info', scoped, 0, false);
446
474
  }
447
475
  // The payload's references: a create's would-be record, or what an update moves the record to.
448
476
  // `id` in a payload is never a scope fact (the payload flag).
@@ -452,13 +480,19 @@ export async function takeSnapshot(ctx, record, parsed, duplicateFields, signal)
452
480
  // The parent the caller names is a scope fact of its own, read live, whatever the payload says.
453
481
  const parent = await parentOf(record.resource);
454
482
  const noteAttachment = record.resource === 'task_note_attachments';
455
- const locatorInput = noteAttachment ? {} : data ?? current ?? {};
483
+ const locatorInput = noteAttachment || assetNoteAttachment ? {} : data ?? current ?? {};
456
484
  const ids = parent === undefined || !isRefId(targets.parentId, parent.resource) ? undefined : await idsFor(parent.resource, targets.parentId, locatorInput);
457
485
  if (parent === undefined || ids === undefined)
458
486
  unresolved.push(`${record.resource}.parent`);
459
487
  else {
460
488
  try {
461
489
  const parentRecord = await get(parent.resource, ids);
490
+ if (assetNoteAttachment && current !== undefined) {
491
+ const attachmentAsset = ci(current, 'configurationItemID');
492
+ if (attachmentAsset != null && attachmentAsset !== ci(parentRecord, 'configurationItemID')) {
493
+ return reason('TARGET_NOT_IN_SCOPE', `${record.id}: the attachment's configuration item association contradicts the note's asset`);
494
+ }
495
+ }
462
496
  if (noteAttachment) {
463
497
  const attachmentTask = current === undefined ? undefined : ci(current, 'taskID');
464
498
  if (attachmentTask != null && attachmentTask !== ci(parentRecord, 'taskID')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iit-mcp-autotask",
3
- "version": "0.63.6",
3
+ "version": "0.63.8",
4
4
  "description": "MCP server for the Autotask (Datto) PSA domain, built on the node-autotask SDK",
5
5
  "license": "MIT",
6
6
  "author": "Max Soukhomlinov",
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@modelcontextprotocol/server": "^2.2.0",
57
- "node-autotask": "0.76.0",
57
+ "node-autotask": "0.78.0",
58
58
  "zod": "^4.6.7"
59
59
  },
60
60
  "devDependencies": {
package/server.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iit-mcp-autotask",
3
- "version": "0.63.6",
3
+ "version": "0.63.8",
4
4
  "description": "MCP server for the Autotask (Datto) PSA API, powered by the node-autotask SDK",
5
5
  "mcpProtocolBaseline": "2026-07-28",
6
6
  "legacyProtocolFallback": "2025-11-25",
@@ -62,7 +62,7 @@
62
62
  "capabilitiesManifest": "capabilities.json",
63
63
  "sdk": {
64
64
  "package": "node-autotask",
65
- "versionRange": "0.76.0"
65
+ "versionRange": "0.78.0"
66
66
  },
67
67
  "vendorExtensions": false,
68
68
  "credentialModelNote": "per-request; server-held under stdio or, on HTTP, only behind AUTOTASK_HTTP_AUTH=tokens; operator plans and the ledger are keyed by principal and tenant id, never by credential, and an apply authenticates the request credential and restores the plan's per-write impersonation"