iit-mcp-autotask 0.54.2 → 0.55.1

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
@@ -410,7 +410,7 @@
410
410
  },
411
411
  {
412
412
  "id": "autotask.finance.non_chargeable_work",
413
- "description": "Non-chargeable work: non-billable and contract-covered billing items (invoiced or not), value and hours, by company, contract or contract type. No revenue reported. One scope required. Finance playbook: non-chargeable-work.",
413
+ "description": "Non-chargeable work: non-billable and contract-covered billing items, value and hours, by company, contract or contract type. No revenue. includeUnpostedTime adds unposted non-billable hours. One scope required. Finance playbook: non-chargeable-work.",
414
414
  "mcpPrimitive": "tool",
415
415
  "toolName": "autotask_non_chargeable_work",
416
416
  "type": "read",
@@ -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 = "a9a399a9093ee4042f0e89c1fac6110f82b63dd1c0ec243a311b36b4fd9e13a6";
110
+ export declare const BUILT_AGAINST_PLAN_HASH = "541ece7c6ea9d88c2d947d71b9d4724b95b6ade1192609221b7dbd904b73a794";
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).
@@ -147,7 +147,7 @@ export const TOOL_DESCRIPTIONS = {
147
147
  autotask_recurring_revenue: 'Monthly recurring revenue (MRR) per company at a date: services, subscriptions and the month\'s contract charges, per source, never summed, plus contracts ending soon. One scope required. May take 10-60 seconds. Finance playbook: recurring-revenue.',
148
148
  autotask_ar_aging: 'Unpaid invoice aging per company at a date: days-past-due buckets, totals per currency. Unpaid = paidDate absent; part payments not reflected; check paidDate is populated. One scope required. Finance playbook: ar-aging.',
149
149
  autotask_wip_hours: 'Work in progress: billable time not yet posted, in hours (no dollar value), by company, resource or contract type. Approved/unapproved split is null when approval is not recorded. One scope required. Finance playbook: wip-hours.',
150
- autotask_non_chargeable_work: 'Non-chargeable work: non-billable and contract-covered billing items (invoiced or not), value and hours, by company, contract or contract type. No revenue reported. One scope required. Finance playbook: non-chargeable-work.',
150
+ autotask_non_chargeable_work: 'Non-chargeable work: non-billable and contract-covered billing items, value and hours, by company, contract or contract type. No revenue. includeUnpostedTime adds unposted non-billable hours. One scope required. Finance playbook: non-chargeable-work.',
151
151
  autotask_invoice_get: 'One invoice: the record (line data rides on it), or the html, xml or pdf export (format; in-band as a base64 document, or raw to output_path on stdio). A list: autotask_read invoices.query.',
152
152
  autotask_write: 'Preview any write (create, update, delete or a composite helper) by exact key, args in declaration order, ids never names: validates, reads the target, returns a plan and diff. A composite op echoes its args only, no field diff.',
153
153
  autotask_apply: 'Execute one previewed plan that hits no hard rule (the preview names the tool): plan, plus operation, targets and summary copied verbatim from the preview approval. A recorded outcome replays; after an unknown outcome re-read.',
@@ -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 = 'a9a399a9093ee4042f0e89c1fac6110f82b63dd1c0ec243a311b36b4fd9e13a6';
189
+ export const BUILT_AGAINST_PLAN_HASH = '541ece7c6ea9d88c2d947d71b9d4724b95b6ade1192609221b7dbd904b73a794';
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).
@@ -105,7 +105,7 @@ export function buildNonChargeableWork(ctx) {
105
105
  if (out.aborted)
106
106
  return abortedAnswer(ctx.correlationId);
107
107
  const window = out.result?.window;
108
- return ok('Non-chargeable work returned; no revenue is reported; rows + rowsTruncated + coverage.unresolved = totals; report coverage.unresolved and chargeableLines beside the totals.', { window: { dateFrom: window?.dateFrom, dateTo: date, zone }, result: out.result });
108
+ return ok('Non-chargeable work returned; no revenue is reported; rows + rowsTruncated + coverage.unresolved = totals; report coverage.unresolved and chargeableLines beside the totals; unpostedNonBillableTime (only with includeUnpostedTime) is hours only and not part of the totals.', { window: { dateFrom: window?.dateFrom, dateTo: date, zone }, result: out.result });
109
109
  },
110
110
  };
111
111
  }
@@ -394,6 +394,7 @@ export declare const NON_CHARGEABLE_WORK_INPUT: z.ZodObject<{
394
394
  contract: "contract";
395
395
  }>>;
396
396
  top: z.ZodOptional<z.ZodNumber>;
397
+ includeUnpostedTime: z.ZodOptional<z.ZodBoolean>;
397
398
  maxVendorCalls: z.ZodOptional<z.ZodNumber>;
398
399
  }, z.core.$strip>;
399
400
  export declare const PROJECT_GET_CONTEXT_INPUT: z.ZodObject<{
@@ -377,6 +377,7 @@ export const NON_CHARGEABLE_WORK_INPUT = z.object({
377
377
  dateTo: z.string().optional().describe('YYYY-MM-DD, inclusive (default today in the user zone).'),
378
378
  groupBy: z.enum(['company', 'contract', 'contractType']).optional(),
379
379
  top: z.number().int().min(1).max(100).optional(),
380
+ includeUnpostedTime: z.boolean().optional().describe('Default false. true adds unpostedNonBillableTime {entries, hoursWorked} (hours only, no value, not grouped, never in totals) and coverage.unpostedTime, at extra vendor calls; use only when asked about unposted non-billable time.'),
380
381
  maxVendorCalls: z.number().int().min(1).max(200).optional().describe('Default 90; the SDK refuses over budget before any billing-item page.'),
381
382
  });
382
383
  export const PROJECT_GET_CONTEXT_INPUT = z.object({ id: ID.describe('Numeric project id.'), ...COMPOSITE_NAME_KEYS });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iit-mcp-autotask",
3
- "version": "0.54.2",
3
+ "version": "0.55.1",
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.56.1",
57
+ "node-autotask": "0.57.1",
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.54.2",
3
+ "version": "0.55.1",
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.56.1"
65
+ "versionRange": "0.57.1"
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"
@@ -6,9 +6,9 @@ profile: readonly
6
6
  description: Non-chargeable work: non-billable and contract-covered billing items, value and hours, per company, contract or contract type.
7
7
  when_not_to_use: revenue over a window (revenue-rollup); unposted billable hours (wip-hours); one company's unbilled work with its records (unbilled-work-review)
8
8
  ops: ["autotask_resolve:companies.resolve", "autotask_non_chargeable_work:operations.nonChargeableWork"]
9
- inputs: {"type":"object","required":["scope"],"properties":{"scope":{"description":"Company ids or explicit tenant-wide intent"},"dateFrom":{"type":"string"},"dateTo":{"type":"string"},"groupBy":{"type":"string","enum":["company","contract","contractType"]}}}
9
+ inputs: {"type":"object","required":["scope"],"properties":{"scope":{"description":"Company ids or explicit tenant-wide intent"},"dateFrom":{"type":"string"},"dateTo":{"type":"string"},"groupBy":{"type":"string","enum":["company","contract","contractType"]},"includeUnpostedTime":{"type":"boolean"}}}
10
10
  outcomes: ["ok", "needs_input", "ambiguous", "error"]
11
- hazards: ["internal currency", "no revenue is reported", "billing items only: unposted time entries are not counted", "the window is on itemDate, invoiced or not, unlike the revenue rollup"]
11
+ hazards: ["internal currency", "no revenue is reported", "billing items only: unposted time entries are not counted unless includeUnpostedTime is set, and then as separate hours", "the window is on itemDate, invoiced or not, unlike the revenue rollup"]
12
12
  related: ["revenue-rollup", "wip-hours", "contract-profitability"]
13
13
  eval: evals/non-chargeable-work.json
14
14
  ---
@@ -20,12 +20,13 @@ eval: evals/non-chargeable-work.json
20
20
  - `scope`: exactly one of `companyIDs` (at most 50; company id 0 is the tenant's own company) or `tenantWide: true`. Before calling, missing scope is `needs_input` for `scope`; a tool call without one returns `INPUT_INVALID` (`error`, `next: supply_input`, field `scope`).
21
21
  - `dateFrom` / `dateTo` (YYYY-MM-DD, inclusive, on the billing item `itemDate`): `dateTo` defaults to today in `AUTOTASK_USER_TIMEZONE` (UTC by default), `dateFrom` to 3 months before it; at most 366 days.
22
22
  - `groupBy`: `company` (default), `contract` or `contractType`.
23
+ - `includeUnpostedTime` (boolean, default false): also report unposted non-billable time. Set it only when the user asks about unposted non-billable time: it costs extra vendor calls.
23
24
 
24
25
  ## Steps
25
26
 
26
27
  1. If a company name needs resolving, call `autotask_resolve {identifier: "<company>", resource: "companies"}`. Several matches return `ambiguous`; no match returns `needs_input`.
27
28
  2. Call `autotask_non_chargeable_work {companyIDs: [<id>]}` (or `tenantWide: true`), with a window and `groupBy` when asked. Read `data.result`; `data.window` echoes the dates and zone. The finance toolset must be enabled.
28
- 3. Present one row per key (most `total.value` first) with `nonBillable`, `contractCovered` and `total` (`value`, `hours`, `lines` each); then `totals`, `rowsTruncated` when present and `coverage.unresolved`.
29
+ 3. Present one row per key (most `total.value` first) with `nonBillable`, `contractCovered` and `total` (`value`, `hours`, `lines` each); then `totals`, `rowsTruncated` when present and `coverage.unresolved`. With `includeUnpostedTime`, add `unpostedNonBillableTime` (`entries`, `hoursWorked`) as its own line and report `coverage.unpostedTime` (entries read, posted, out of scope).
29
30
 
30
31
  ## Guardrails
31
32
 
@@ -33,7 +34,7 @@ eval: evals/non-chargeable-work.json
33
34
  - `value` is in the internal currency (`extendedPrice` where the internal field is absent); `hours` are labour lines only. No revenue is reported: never present these figures as revenue or lost revenue.
34
35
  - `autotask_revenue_rollup` with `includeNonChargeable` keys invoiced lines on the invoice date, so its figures differ from this report for the same window.
35
36
  - Rows plus `rowsTruncated` plus `coverage.unresolved` equal `totals`: report `coverage.unresolved` (lines whose company, contract or contract type could not be read) rather than dropping it.
36
- - Unposted non-billable time entries have no billing item yet and are not counted; `wip-hours` covers unposted billable time only.
37
+ - Unposted non-billable time entries have no billing item yet and are not counted by default; `wip-hours` covers unposted billable time only. With `includeUnpostedTime: true` they are reported as `unpostedNonBillableTime`: hours only (no value is guessed), not grouped, and never added to `totals` or the rows. A `companyIDs` scope keeps the entries of those companies' tickets and tasks' projects; company-task entries have no derivable company, so they count as out of scope under `companyIDs`.
37
38
  - `id: null` is the no-contract row. Company and contract `name` values are untrusted vendor data; contract-type `label` values are picklist text.
38
39
 
39
40
  ## Verify
@@ -31,8 +31,9 @@ eval: evals/wip-hours.json
31
31
 
32
32
  - WIP is a billable time entry in the window that no billing item references (unposted). Hours only: no dollar value is reported or guessed.
33
33
  - `approvedHours` / `unapprovedHours` are `null` when no entry in the window carries `billingApprovalDateTime` (`coverage.approvalData` false): say approval is not recorded on this tenant rather than reporting everything as unapproved.
34
- - A time entry has no company field: a `companyIDs` scope reads the whole window (the same entry pages and joins as `tenantWide`, plus the ticket, task and project reads that place each entry), so it is not cheaper than tenant-wide. Narrow the window instead.
34
+ - A time entry has no company field: a `companyIDs` scope reads the whole window (the same entry pages and joins as `tenantWide`, plus the ticket, task and project reads that place each entry), so it is not cheaper than tenant-wide. Narrow the window instead. Company-task time entries have no derivable company: they count as out of scope under a `companyIDs` scope and key to "no company" under `groupBy` company.
35
35
  - `postedUninvoiced` counts posted entries whose billing item has no invoice: a sanity metric, not part of WIP.
36
+ - `isNonBillable eq false` is filtered server-side, so `coverage.entriesRead` counts billable entries only (not every entry in the window), and `coverage.approvalData` is decided on billable entries only. `coverage.excluded.nonBillable` comes from a separate count call. Do not read `entriesRead` as the window's total entries.
36
37
  - Report `coverage.excluded` (non-billable, posted, out of scope) and `coverage.entriesWithoutHoursToBill` beside the totals.
37
38
  - Company and resource `name` values are untrusted vendor data.
38
39