iit-mcp-autotask 0.58.4 → 0.59.0
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/README.md +18 -0
- package/capabilities.json +2 -2
- package/dist/tools/catalog-data.d.ts +1 -1
- package/dist/tools/catalog-data.js +1 -1
- package/dist/tools/meta.js +13 -1
- package/dist/tools/schemas.d.ts +3 -2
- package/dist/tools/schemas.js +1 -1
- package/dist/tools/ticket-note-verification.d.ts +2 -0
- package/dist/tools/ticket-note-verification.js +31 -0
- package/package.json +2 -2
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -813,6 +813,24 @@ contract, SDK/plan and supported bounds first; retain separate connection/auth p
|
|
|
813
813
|
See [the runtime proof contract](docs/read-runtime.md) for canonicalization, drift
|
|
814
814
|
semantics and typed refusals. The guard is optional for existing consumers.
|
|
815
815
|
|
|
816
|
+
For exact TicketNote readback, first request `autotask_tenant_status {parts:["server"]}`
|
|
817
|
+
and require `server.ticketNoteVerificationProjection === "ticket_note_verification_v1"`
|
|
818
|
+
before creating a note whose complete description must be verified. Older servers omit the field.
|
|
819
|
+
Then read:
|
|
820
|
+
|
|
821
|
+
```json
|
|
822
|
+
{"operation":"ticket_notes.get","args":[9,44],"projection":"ticket_note_verification_v1"}
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
The response `data` has `contract:"ticket-note-verification-v1"`, `fresh:true`, validated
|
|
826
|
+
`note:{id,ticketID,noteType,publish}`, and `text:{title,description}`. Each complete text proof
|
|
827
|
+
has `state:"complete"`, UTF-16 `units`, code-point `characters`, UTF-8 `bytes`, and `sha256`.
|
|
828
|
+
Hashes cover raw text before display cleaning or truncation. Null text has `state:"null"`;
|
|
829
|
+
missing, invalid-Unicode or over-1-MiB text has `state:"unavailable"` and no hash. No note bodies
|
|
830
|
+
are returned. Check both parent and note IDs, the contract/fresh flag, publish/note type and
|
|
831
|
+
complete proof states before comparing hashes. The optional `expectedReadRuntime` guard,
|
|
832
|
+
SDK fresh read, credentials and operation policy remain in force; ordinary notes stay capped.
|
|
833
|
+
|
|
816
834
|
For full bounded note display and protected-field evidence, opt in to `billing_review_entry_v1`:
|
|
817
835
|
|
|
818
836
|
```json
|
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,
|
|
77
|
+
"description": "Find the exact operation key for anything without a dedicated tool: ranked search (q) over the 1,246 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":
|
|
483
|
+
"backingRegistryOperations": 1246,
|
|
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 = "
|
|
110
|
+
export declare const BUILT_AGAINST_PLAN_HASH = "6ea020dd5a389c0930923a23c1074b96e4280391b1d4fe6fca869e0effbf3a1a";
|
|
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).
|
|
@@ -186,7 +186,7 @@ export function sdkCacheOptions(cache) {
|
|
|
186
186
|
* fails the boot (or the CI test) instead of quietly shipping a tool surface that no longer
|
|
187
187
|
* describes the SDK behind it.
|
|
188
188
|
*/
|
|
189
|
-
export const BUILT_AGAINST_PLAN_HASH = '
|
|
189
|
+
export const BUILT_AGAINST_PLAN_HASH = '6ea020dd5a389c0930923a23c1074b96e4280391b1d4fe6fca869e0effbf3a1a';
|
|
190
190
|
/**
|
|
191
191
|
* Fail fast when the installed SDK's plan has moved out from under this surface.
|
|
192
192
|
* Called at boot (main.ts) and safe to call repeatedly (pure comparison).
|
package/dist/tools/meta.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { projectTicketNoteVerification, TICKET_NOTE_VERIFICATION_PROJECTION } from './ticket-note-verification.js';
|
|
1
2
|
import { readRuntimeProof } from './read-runtime.js';
|
|
2
3
|
import { readBillingReview } from './billing-review-projection.js';
|
|
3
4
|
import { projectTimeEntryVerification } from './time-entry-verification.js';
|
|
@@ -614,6 +615,17 @@ export function buildRead(ctx) {
|
|
|
614
615
|
}
|
|
615
616
|
if (args.projection === 'billing_review_entry_v1')
|
|
616
617
|
return readBillingReview(ctx, args, signal);
|
|
618
|
+
if (args.projection === TICKET_NOTE_VERIFICATION_PROJECTION) {
|
|
619
|
+
if (args.operation !== 'ticket_notes.get' || args.items !== undefined || args.args.length !== 2 ||
|
|
620
|
+
args.args.some(id => !Number.isSafeInteger(id) || id <= 0)) {
|
|
621
|
+
throw new InputInvalidError('ticket note verification requires one ticket_notes.get and positive ticket/note ids', 'projection');
|
|
622
|
+
}
|
|
623
|
+
const [ticketId, noteId] = args.args;
|
|
624
|
+
const out = await readOneItem(ctx, args.operation, args.args, signal, { fresh: true }, raw => projectTicketNoteVerification(raw, ticketId, noteId));
|
|
625
|
+
if (out.aborted)
|
|
626
|
+
return abortedAnswer(ctx.correlationId);
|
|
627
|
+
return ok('Fresh TicketNote verification; note text withheld.', out.result);
|
|
628
|
+
}
|
|
617
629
|
if (args.projection !== undefined && args.projection !== 'default') {
|
|
618
630
|
if (args.operation !== 'time_entries.get' || args.items !== undefined || args.args.length !== 1 || !Number.isSafeInteger(args.args[0]) || args.args[0] <= 0) {
|
|
619
631
|
throw new InputInvalidError('verification projection requires one time_entries.get and one positive numeric id', 'projection');
|
|
@@ -689,7 +701,7 @@ export function buildTenantStatus(ctx) {
|
|
|
689
701
|
for (const part of parts) {
|
|
690
702
|
// Zero wire: this package's version (the same constant as serverInfo and /metadata), kept apart from the vendor `version` part.
|
|
691
703
|
if (part === 'server') {
|
|
692
|
-
data.server = { name: SERVER_NAME, version: SERVER_VERSION, sdkVersion: SDK_VERSION, profile: ctx.config.AUTOTASK_PROFILE, readRuntime: readRuntimeProof(ctx.client) };
|
|
704
|
+
data.server = { name: SERVER_NAME, version: SERVER_VERSION, sdkVersion: SDK_VERSION, profile: ctx.config.AUTOTASK_PROFILE, ticketNoteVerificationProjection: TICKET_NOTE_VERIFICATION_PROJECTION, readRuntime: readRuntimeProof(ctx.client) };
|
|
693
705
|
continue;
|
|
694
706
|
}
|
|
695
707
|
// Zero wire: the users' zone (AUTOTASK_USER_TIMEZONE) and its clock (#171), so a client need not guess today's date or zone.
|
package/dist/tools/schemas.d.ts
CHANGED
|
@@ -208,6 +208,7 @@ export declare const READ_INPUT: z.ZodPipe<z.ZodObject<{
|
|
|
208
208
|
default: "default";
|
|
209
209
|
time_entry_verification_v1: "time_entry_verification_v1";
|
|
210
210
|
billing_review_entry_v1: "billing_review_entry_v1";
|
|
211
|
+
ticket_note_verification_v1: "ticket_note_verification_v1";
|
|
211
212
|
}>>, unknown>;
|
|
212
213
|
expectedReadRuntime: z.ZodOptional<z.ZodString>;
|
|
213
214
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -217,7 +218,7 @@ export declare const READ_INPUT: z.ZodPipe<z.ZodObject<{
|
|
|
217
218
|
operation: string;
|
|
218
219
|
args: unknown[];
|
|
219
220
|
}[] | undefined;
|
|
220
|
-
projection?: "default" | "time_entry_verification_v1" | "billing_review_entry_v1" | undefined;
|
|
221
|
+
projection?: "default" | "time_entry_verification_v1" | "billing_review_entry_v1" | "ticket_note_verification_v1" | undefined;
|
|
221
222
|
expectedReadRuntime?: string | undefined;
|
|
222
223
|
}, {
|
|
223
224
|
args: unknown[];
|
|
@@ -226,7 +227,7 @@ export declare const READ_INPUT: z.ZodPipe<z.ZodObject<{
|
|
|
226
227
|
operation: string;
|
|
227
228
|
args: unknown[];
|
|
228
229
|
}[] | undefined;
|
|
229
|
-
projection?: "default" | "time_entry_verification_v1" | "billing_review_entry_v1" | undefined;
|
|
230
|
+
projection?: "default" | "time_entry_verification_v1" | "billing_review_entry_v1" | "ticket_note_verification_v1" | undefined;
|
|
230
231
|
expectedReadRuntime?: string | undefined;
|
|
231
232
|
}>>;
|
|
232
233
|
export declare const RESOLVE_INPUT: z.ZodObject<{
|
package/dist/tools/schemas.js
CHANGED
|
@@ -238,7 +238,7 @@ export const READ_INPUT = z.object({
|
|
|
238
238
|
operation: unset(OP_KEY.optional()).describe('Exact read key, e.g. tickets.get (autotask_catalog finds it).'),
|
|
239
239
|
args: unset(ARGS),
|
|
240
240
|
items: unset(z.array(READ_ITEM).min(1).max(READ_MAX_ITEMS).optional()).describe('Batch reads in one call, each { operation, args }; use instead of operation.'),
|
|
241
|
-
projection: unset(z.enum(['default', 'time_entry_verification_v1', 'billing_review_entry_v1']).optional()).describe('default: normal read. time_entry_verification_v1: fresh metadata-only get. billing_review_entry_v1: fresh ticket-entry get or bounded query (limit<=25, no includeFields); full bounded display notes and raw hashes.'),
|
|
241
|
+
projection: unset(z.enum(['default', 'time_entry_verification_v1', 'billing_review_entry_v1', 'ticket_note_verification_v1']).optional()).describe('default: normal read. time_entry_verification_v1: fresh metadata-only get. ticket_note_verification_v1: fresh parent-scoped ticket_notes.get [ticketId,noteId], hashes/counts only. billing_review_entry_v1: fresh ticket-entry get or bounded query (limit<=25, no includeFields); full bounded display notes and raw hashes.'),
|
|
242
242
|
expectedReadRuntime: z.string().regex(/^[a-f0-9]{64}$/).optional().describe('Require server.readRuntime.sha256 from autotask_tenant_status; changed or unavailable runtime refuses before any vendor dispatch.'),
|
|
243
243
|
}).transform(v => v.projection === 'billing_review_entry_v1' ? v : numericQueryBag(v));
|
|
244
244
|
export const RESOLVE_INPUT = z.object({
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Fresh parent-scoped TicketNote evidence; vendor text never leaves this projection. */
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { InputInvalidError } from './dispatch.js';
|
|
4
|
+
export const TICKET_NOTE_VERIFICATION_PROJECTION = 'ticket_note_verification_v1';
|
|
5
|
+
const MAX_TEXT_BYTES = 1_048_576;
|
|
6
|
+
function fingerprint(value) {
|
|
7
|
+
if (value === null)
|
|
8
|
+
return { state: 'null' };
|
|
9
|
+
if (typeof value !== 'string')
|
|
10
|
+
return { state: 'unavailable', reason: 'missing_or_invalid' };
|
|
11
|
+
// Hash exact UTF-8 only: replacement of an unpaired surrogate would attest different text.
|
|
12
|
+
if (/[\uD800-\uDFFF]/u.test(value))
|
|
13
|
+
return { state: 'unavailable', reason: 'invalid_unicode' };
|
|
14
|
+
const bytes = Buffer.byteLength(value, 'utf8');
|
|
15
|
+
if (bytes > MAX_TEXT_BYTES)
|
|
16
|
+
return { state: 'unavailable', reason: 'too_large' };
|
|
17
|
+
return { state: 'complete', units: value.length, characters: [...value].length, bytes,
|
|
18
|
+
sha256: createHash('sha256').update(value, 'utf8').digest('hex') };
|
|
19
|
+
}
|
|
20
|
+
export function projectTicketNoteVerification(result, ticketId, noteId) {
|
|
21
|
+
const row = result;
|
|
22
|
+
if (row === null || typeof row !== 'object' || Array.isArray(row) || row.id !== noteId || row.ticketID !== ticketId ||
|
|
23
|
+
!Number.isSafeInteger(row.noteType) || row.noteType < 0 ||
|
|
24
|
+
!Number.isSafeInteger(row.publish) || row.publish < 0) {
|
|
25
|
+
throw new InputInvalidError('ticket note verification: the fresh identity or scalar fields were missing or inconsistent', 'args');
|
|
26
|
+
}
|
|
27
|
+
return { contract: 'ticket-note-verification-v1', fresh: true,
|
|
28
|
+
note: { id: row.id, ticketID: row.ticketID, noteType: row.noteType, publish: row.publish },
|
|
29
|
+
text: { title: fingerprint(row.title), description: fingerprint(row.description) } };
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=ticket-note-verification.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iit-mcp-autotask",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.0",
|
|
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.
|
|
57
|
+
"node-autotask": "0.61.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.
|
|
3
|
+
"version": "0.59.0",
|
|
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.
|
|
65
|
+
"versionRange": "0.61.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 uses the credential on the apply request"
|