iit-mcp-autotask 0.63.6 → 0.63.7

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,308 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": 1308,
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": {}
@@ -143,6 +143,10 @@ export function resolveWritePolicy(env) {
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 = "3b14a93bbda886bce89c87d61ba40092f9acf6a829a959f042be1c3a0744ed42";
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 = '3b14a93bbda886bce89c87d61ba40092f9acf6a829a959f042be1c3a0744ed42';
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', '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,8 @@ 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 strictAttachment = taskAttachment || assetAttachment || operation === 'task_note_attachments.create' || operation === 'task_note_attachments.delete';
69
79
  // The write's own TARGET record is hashed in full (an update/delete must notice any change to it);
70
80
  // a record that is only REFERENCED (the ticket a time entry is logged on) is hashed by its stable
71
81
  // facts only, so a volatile stamp the first of two outstanding writes moves (lastActivityDate,
@@ -83,7 +93,7 @@ function createReader(ctx, targetKey, signal, operation) {
83
93
  if (v === undefined)
84
94
  throw new Cancelled();
85
95
  const model = v;
86
- const hasCompanyScope = resource === 'projects' || resource === 'contracts';
96
+ const hasCompanyScope = resource === 'projects' || resource === 'contracts' || (assetAttachment && resource === 'configuration_items');
87
97
  if (strictAttachment && (ci(model, 'id') !== ids.at(-1) || (hasCompanyScope && !isRefId(ci(model, 'companyID'), 'companies')))) {
88
98
  throw new AttachmentScopeUnresolved(`${resource}: the fresh record did not establish the requested identity and scope`);
89
99
  }
@@ -166,6 +176,9 @@ function createReader(ctx, targetKey, signal, operation) {
166
176
  const attachmentOrigin = taskAttachment && !payload && (resource === 'attachment_info' || resource === 'task_attachments');
167
177
  if (attachmentOrigin)
168
178
  refs.push(['taskNoteID', 'task_notes'], ['timeEntryID', 'time_entries']);
179
+ if (assetAttachment && !payload && (resource === 'attachment_info' || resource === 'configuration_item_attachments')) {
180
+ refs.push(['configurationItemNoteID', 'configuration_item_notes']);
181
+ }
169
182
  const children = await drainReads(refs.map(async ([field, res]) => {
170
183
  let read;
171
184
  try {
@@ -423,12 +436,13 @@ export async function takeSnapshot(ctx, record, parsed, duplicateFields, signal)
423
436
  }
424
437
  }
425
438
  if (data !== undefined) {
426
- if (record.id === 'task_attachments.create' && ci(data, 'parentAttachmentID') !== undefined) {
439
+ const nestedAsset = record.id === 'configuration_item_attachments.create';
440
+ if ((nestedAsset || record.id === 'task_attachments.create') && ci(data, 'parentAttachmentID') !== undefined) {
427
441
  const parentAttachmentID = ci(data, 'parentAttachmentID');
428
442
  if (!isRefId(parentAttachmentID, 'attachment_info')) {
429
443
  return reason('INPUT_INVALID', `${record.id}: parentAttachmentID must identify an attachment`, 'data.parentAttachmentID');
430
444
  }
431
- const unproved = reason('TARGET_NOT_IN_SCOPE', `${record.id}: the parent attachment's task scope could not be established`);
445
+ const unproved = reason('TARGET_NOT_IN_SCOPE', `${record.id}: the parent attachment's ${nestedAsset ? 'configuration item' : 'task'} scope could not be established`);
432
446
  let attachment;
433
447
  try {
434
448
  attachment = await get('attachment_info', [parentAttachmentID]);
@@ -438,11 +452,19 @@ export async function takeSnapshot(ctx, record, parsed, duplicateFields, signal)
438
452
  throw err;
439
453
  return unproved;
440
454
  }
441
- if (!isRefId(ci(attachment, 'taskID'), 'tasks') || ci(attachment, 'taskID') !== targets.parentId)
455
+ const parentResource = nestedAsset ? 'configuration_items' : 'tasks';
456
+ const owner = nestedAsset ? assetOrigin(attachment, 'configurationItemID', 'installedProductID') : ci(attachment, 'taskID');
457
+ if (!isRefId(owner, parentResource) || owner !== targets.parentId)
442
458
  return unproved;
459
+ const scoped = nestedAsset ? {
460
+ ...attachment,
461
+ configurationItemID: owner,
462
+ configurationItemNoteID: assetOrigin(attachment, 'configurationItemNoteID', 'installedProductNoteID'),
463
+ } : attachment;
443
464
  // 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);
465
+ const originFields = nestedAsset ? ['parentAttachmentID', 'configurationItemID', 'configurationItemNoteID'] : ['parentAttachmentID', 'taskNoteID', 'timeEntryID'];
466
+ hashed[`attachment_info:${parentAttachmentID}:origin`] = originFields.map(field => ci(scoped, field));
467
+ await anchor('attachment_info', scoped, 0, false);
446
468
  }
447
469
  // The payload's references: a create's would-be record, or what an update moves the record to.
448
470
  // `id` in a payload is never a scope fact (the payload flag).
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.7",
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.77.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.7",
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.77.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"