iit-mcp-autotask 0.63.2 → 0.63.4

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,276 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,287 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": 1276,
483
+ "backingRegistryOperations": 1287,
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": {}
@@ -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 = "79f3968f072705fbc7b479dba6863a27bde47deee7b85885eda8d019302f9c25";
110
+ export declare const BUILT_AGAINST_PLAN_HASH = "cff16b0b9d022a81a1926ffacb0d01cf5a1e924805447744b62865a3cf9d3779";
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 = '79f3968f072705fbc7b479dba6863a27bde47deee7b85885eda8d019302f9c25';
190
+ export const BUILT_AGAINST_PLAN_HASH = 'cff16b0b9d022a81a1926ffacb0d01cf5a1e924805447744b62865a3cf9d3779';
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).
@@ -10,10 +10,6 @@ export declare function buildCatalog(ctx: ToolContext): BuiltTool;
10
10
  export declare function paramNames(operation: string, rec: unknown): Record<string, unknown> | undefined;
11
11
  /** `autotask_describe`: one operation's record + verdict + playbooks, or one resource's relationship map. */
12
12
  export declare function buildDescribe(ctx: ToolContext): BuiltTool;
13
- /** The single place to extend: entities the registry has no create for, yet the vendor documentation lists one, so the
14
- * note would be false. `time_off_requests`: the swagger has a child create (POST /V1.0/Resources/{parentId}/TimeOffRequests,
15
- * TimeOffRequestsChild_CreateEntity) and the SDK defines TimeOffRequestCreate; the SDK plan simply has no create row. */
16
- export declare const NO_CREATE_EXCLUDED: ReadonlySet<string>;
17
13
  /** The entities that carry the noCreate note (pinned by name in a test). */
18
14
  export declare const NO_CREATE_ENTITIES: ReadonlySet<string>;
19
15
  /** `autotask_read`: one read by exact key, or up to 10 (`items`) with per-item results. */
@@ -280,12 +280,8 @@ const SERVER_DEFAULTS = {
280
280
  * node-autotask 0.34.0; method in docs/architecture.md). The note claims no more than that. */
281
281
  const CREATE_RESOURCES = new Set(RECORDS.filter((r) => r.id.endsWith('.create')).map((r) => r.resource));
282
282
  const ENTITY_RESOURCES = new Set(RECORDS.filter((r) => r.id.endsWith('.getEntityInfo')).map((r) => r.resource));
283
- /** The single place to extend: entities the registry has no create for, yet the vendor documentation lists one, so the
284
- * note would be false. `time_off_requests`: the swagger has a child create (POST /V1.0/Resources/{parentId}/TimeOffRequests,
285
- * TimeOffRequestsChild_CreateEntity) and the SDK defines TimeOffRequestCreate; the SDK plan simply has no create row. */
286
- export const NO_CREATE_EXCLUDED = new Set(['time_off_requests']);
287
283
  /** The entities that carry the noCreate note (pinned by name in a test). */
288
- export const NO_CREATE_ENTITIES = new Set([...ENTITY_RESOURCES].filter((r) => !CREATE_RESOURCES.has(r) && !NO_CREATE_EXCLUDED.has(r)));
284
+ export const NO_CREATE_ENTITIES = new Set([...ENTITY_RESOURCES].filter((r) => !CREATE_RESOURCES.has(r)));
289
285
  const NO_CREATE_NOTE = 'do not look for a create operation: this server has none for this entity, and the vendor API documentation lists none.';
290
286
  /**
291
287
  * S8 (#183): the UDF block for `describe {resource}`: the mechanism facts (SDK row shape) + the definitions
@@ -27,7 +27,7 @@ export declare function sanitisedArtefact(value: unknown, path: string, depth?:
27
27
  * The SDK's dry-run `impact.reversible` speaks for the vendor, not this deployment (live-test
28
28
  * finding): every delete in the registry needs approval (`requiresApproval` or `sensitive`, hard
29
29
  * rules), so this server can never undo a create or a delete.
30
- * An update keeps the SDK's answer (an update under the same rule reverses it).
30
+ * An update keeps the SDK's answer, including irreversible cancellation.
31
31
  */
32
32
  export declare function honestImpact(impact: unknown, shape: WriteShape): unknown;
33
33
  /**
@@ -70,7 +70,7 @@ export function sanitisedArtefact(value, path, depth = 0) {
70
70
  * The SDK's dry-run `impact.reversible` speaks for the vendor, not this deployment (live-test
71
71
  * finding): every delete in the registry needs approval (`requiresApproval` or `sensitive`, hard
72
72
  * rules), so this server can never undo a create or a delete.
73
- * An update keeps the SDK's answer (an update under the same rule reverses it).
73
+ * An update keeps the SDK's answer, including irreversible cancellation.
74
74
  */
75
75
  export function honestImpact(impact, shape) {
76
76
  if (impact === null || typeof impact !== 'object' || Array.isArray(impact) || shape.startsWith('update'))
@@ -57,7 +57,7 @@ export function getIds(ctx, resource, parentId, id) {
57
57
  return parentId !== undefined && !hasSimpleGet(resource, ctx) ? [parentId, id] : [id];
58
58
  }
59
59
  /** 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. */
60
- function createReader(ctx, targetKey, signal) {
60
+ function createReader(ctx, targetKey, signal, requirePredecessorInPayload = false) {
61
61
  const reads = {};
62
62
  const hashed = {};
63
63
  const companies = new Set();
@@ -144,19 +144,30 @@ function createReader(ctx, targetKey, signal) {
144
144
  // parent, ticketID, projectID, taskID, contractID), each read live. The union is what the scope
145
145
  // checks; no single field (least of all one in the caller's payload) stands for the rest. A
146
146
  // reference that cannot be read is recorded and the write is refused (fail closed).
147
- const acquireAnchor = async (resource, rec, depth, payload) => {
147
+ const acquireAnchor = async (resource, rec, depth, payload, includeParent = true) => {
148
148
  try {
149
- const parent = await parentOf(resource);
149
+ const parent = includeParent ? await parentOf(resource) : undefined;
150
150
  const refs = [...(parent === undefined ? [] : [[parent.field, parent.resource]]), ...ANCHORS.filter(([f]) => f !== parent?.field)];
151
+ // The successor is the route parent. The other task also contributes scope and stable facts.
152
+ if (resource === 'task_predecessors')
153
+ refs.push(['predecessorTaskID', 'tasks']);
151
154
  const children = await drainReads(refs.map(async ([field, res]) => {
152
155
  let read;
153
156
  try {
154
157
  const value = ci(rec, field);
155
- if (value === undefined || value === null)
156
- read = { kind: 'absent' };
158
+ if (value === undefined || value === null) {
159
+ const required = field === 'predecessorTaskID' && (!payload || requirePredecessorInPayload);
160
+ read = { kind: required ? 'missing' : 'absent' };
161
+ }
157
162
  else {
158
163
  const ids = isRefId(value, res) && depth < 3 ? await idsFor(res, value, rec) : undefined;
159
- read = ids === undefined ? { kind: 'missing' } : { kind: 'record', record: await get(res, ids) };
164
+ if (ids === undefined)
165
+ read = { kind: 'missing' };
166
+ else {
167
+ const target = await get(res, ids);
168
+ const wrongTask = resource === 'task_predecessors' && res === 'tasks' && ci(target, 'id') !== value;
169
+ read = wrongTask ? { kind: 'missing' } : { kind: 'record', record: target };
170
+ }
160
171
  }
161
172
  }
162
173
  catch (error) {
@@ -206,8 +217,8 @@ function createReader(ctx, targetKey, signal) {
206
217
  mergeAnchor(child.tree);
207
218
  }
208
219
  };
209
- const anchor = async (resource, rec, depth, payload) => {
210
- mergeAnchor(await acquireAnchor(resource, rec, depth, payload));
220
+ const anchor = async (resource, rec, depth, payload, includeParent = true) => {
221
+ mergeAnchor(await acquireAnchor(resource, rec, depth, payload, includeParent));
211
222
  };
212
223
  return { reads, hashed, companies, unresolved, get, idsFor, anchor };
213
224
  }
@@ -260,7 +271,10 @@ export async function takeCallSnapshot(ctx, record, parsed, signal) {
260
271
  throw err;
261
272
  return reason('INPUT_INVALID', `${record.resource} ${selfId} does not exist`, 'args.0');
262
273
  }
263
- await r.anchor(record.resource, current, 0, false);
274
+ // The resource parent describes scoped submission and cancellation. The existing
275
+ // global approval calls use the request itself and require no staff-record read.
276
+ const globalLeaveAction = record.id === 'time_off_requests.approve' || record.id === 'time_off_requests.reject';
277
+ await r.anchor(record.resource, current, 0, false, !globalLeaveAction);
264
278
  }
265
279
  for (const [i, name] of names.entries()) {
266
280
  const value = parsed.args[i];
@@ -322,7 +336,7 @@ export async function takeSnapshot(ctx, record, parsed, duplicateFields, signal)
322
336
  return reason('INPUT_INVALID', `${record.id}: parentId 0 names no record; write targets are ids, never names (resolve a name with autotask_resolve first)`, 'args.0');
323
337
  }
324
338
  const targetKey = parsed.targets.id === undefined ? undefined : `${record.resource}:${getIds(ctx, record.resource, parsed.targets.parentId, parsed.targets.id).join('/')}`;
325
- const r = createReader(ctx, targetKey, signal);
339
+ const r = createReader(ctx, targetKey, signal, record.id === 'task_predecessors.create');
326
340
  const { get, idsFor, anchor, reads, hashed, unresolved, companies } = r;
327
341
  const { targets, data } = parsed;
328
342
  const parent = targets.parentId === undefined ? undefined : await parentOf(record.resource);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iit-mcp-autotask",
3
- "version": "0.63.2",
3
+ "version": "0.63.4",
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.72.0",
57
+ "node-autotask": "0.74.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.2",
3
+ "version": "0.63.4",
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.72.0"
65
+ "versionRange": "0.74.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"