iit-mcp-autotask 0.54.2
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/.env.example +123 -0
- package/LICENSE +21 -0
- package/README.md +788 -0
- package/capabilities.json +487 -0
- package/dist/access/gate.d.ts +34 -0
- package/dist/access/gate.js +76 -0
- package/dist/access/grants.d.ts +20 -0
- package/dist/access/grants.js +35 -0
- package/dist/access/write-env.d.ts +41 -0
- package/dist/access/write-env.js +166 -0
- package/dist/auth.d.ts +74 -0
- package/dist/auth.js +129 -0
- package/dist/base-hosts.d.ts +38 -0
- package/dist/base-hosts.js +70 -0
- package/dist/config/load.d.ts +28 -0
- package/dist/config/load.js +105 -0
- package/dist/config/schema.d.ts +166 -0
- package/dist/config/schema.js +311 -0
- package/dist/credential.d.ts +28 -0
- package/dist/credential.js +32 -0
- package/dist/doctor.d.ts +112 -0
- package/dist/doctor.js +154 -0
- package/dist/http-guard.d.ts +57 -0
- package/dist/http-guard.js +134 -0
- package/dist/http.d.ts +50 -0
- package/dist/http.js +290 -0
- package/dist/lifecycle.d.ts +29 -0
- package/dist/lifecycle.js +52 -0
- package/dist/logger.d.ts +26 -0
- package/dist/logger.js +28 -0
- package/dist/main.d.ts +12 -0
- package/dist/main.js +283 -0
- package/dist/policy.d.ts +54 -0
- package/dist/policy.js +80 -0
- package/dist/tools/aggregate.d.ts +16 -0
- package/dist/tools/aggregate.js +64 -0
- package/dist/tools/capabilities-manifest.d.ts +4 -0
- package/dist/tools/capabilities-manifest.js +94 -0
- package/dist/tools/catalog-data.d.ts +116 -0
- package/dist/tools/catalog-data.js +207 -0
- package/dist/tools/clock.d.ts +17 -0
- package/dist/tools/clock.js +43 -0
- package/dist/tools/composites.d.ts +36 -0
- package/dist/tools/composites.js +305 -0
- package/dist/tools/context/client.d.ts +41 -0
- package/dist/tools/context/client.js +139 -0
- package/dist/tools/context/derive.d.ts +9 -0
- package/dist/tools/context/derive.js +32 -0
- package/dist/tools/context/scope.d.ts +24 -0
- package/dist/tools/context/scope.js +180 -0
- package/dist/tools/context/types.d.ts +141 -0
- package/dist/tools/context/types.js +2 -0
- package/dist/tools/dispatch.d.ts +78 -0
- package/dist/tools/dispatch.js +272 -0
- package/dist/tools/field-pointer.d.ts +25 -0
- package/dist/tools/field-pointer.js +45 -0
- package/dist/tools/guide.d.ts +30 -0
- package/dist/tools/guide.js +97 -0
- package/dist/tools/lists.d.ts +9 -0
- package/dist/tools/lists.js +205 -0
- package/dist/tools/meta.d.ts +22 -0
- package/dist/tools/meta.js +709 -0
- package/dist/tools/output-file.d.ts +26 -0
- package/dist/tools/output-file.js +140 -0
- package/dist/tools/rank.d.ts +21 -0
- package/dist/tools/rank.js +57 -0
- package/dist/tools/reasons.d.ts +33 -0
- package/dist/tools/reasons.js +121 -0
- package/dist/tools/register.d.ts +23 -0
- package/dist/tools/register.js +50 -0
- package/dist/tools/resolves.d.ts +28 -0
- package/dist/tools/resolves.js +399 -0
- package/dist/tools/results/envelope.d.ts +55 -0
- package/dist/tools/results/envelope.js +63 -0
- package/dist/tools/results/errors.d.ts +147 -0
- package/dist/tools/results/errors.js +384 -0
- package/dist/tools/results/untrusted.d.ts +129 -0
- package/dist/tools/results/untrusted.js +218 -0
- package/dist/tools/revenue-rollup.d.ts +8 -0
- package/dist/tools/revenue-rollup.js +112 -0
- package/dist/tools/schemas.d.ts +467 -0
- package/dist/tools/schemas.js +444 -0
- package/dist/tools/scope-guard.d.ts +2 -0
- package/dist/tools/scope-guard.js +11 -0
- package/dist/tools/server-version.d.ts +3 -0
- package/dist/tools/server-version.js +14 -0
- package/dist/tools/server.d.ts +92 -0
- package/dist/tools/server.js +170 -0
- package/dist/tools/surface.d.ts +37 -0
- package/dist/tools/surface.js +94 -0
- package/dist/tools/tsv.d.ts +52 -0
- package/dist/tools/tsv.js +95 -0
- package/dist/tools/write/apply.d.ts +40 -0
- package/dist/tools/write/apply.js +500 -0
- package/dist/tools/write/checks.d.ts +39 -0
- package/dist/tools/write/checks.js +137 -0
- package/dist/tools/write/common.d.ts +23 -0
- package/dist/tools/write/common.js +33 -0
- package/dist/tools/write/facts.d.ts +52 -0
- package/dist/tools/write/facts.js +151 -0
- package/dist/tools/write/outcome.d.ts +23 -0
- package/dist/tools/write/outcome.js +67 -0
- package/dist/tools/write/parse.d.ts +37 -0
- package/dist/tools/write/parse.js +166 -0
- package/dist/tools/write/payload.d.ts +44 -0
- package/dist/tools/write/payload.js +119 -0
- package/dist/tools/write/preview.d.ts +3 -0
- package/dist/tools/write/preview.js +317 -0
- package/dist/tools/write/snapshot.d.ts +68 -0
- package/dist/tools/write/snapshot.js +360 -0
- package/dist/tools/write-guidance.d.ts +174 -0
- package/dist/tools/write-guidance.js +317 -0
- package/dist/tools/write.d.ts +9 -0
- package/dist/tools/write.js +10 -0
- package/dist/write/canonical.d.ts +12 -0
- package/dist/write/canonical.js +31 -0
- package/dist/write/evaluate.d.ts +77 -0
- package/dist/write/evaluate.js +91 -0
- package/dist/write/hard-rules.d.ts +49 -0
- package/dist/write/hard-rules.js +48 -0
- package/dist/write/runtime.d.ts +37 -0
- package/dist/write/runtime.js +72 -0
- package/dist/write/store/audit-log.d.ts +13 -0
- package/dist/write/store/audit-log.js +25 -0
- package/dist/write/store/constants.d.ts +34 -0
- package/dist/write/store/constants.js +35 -0
- package/dist/write/store/files.d.ts +44 -0
- package/dist/write/store/files.js +157 -0
- package/dist/write/store/heartbeat.d.ts +9 -0
- package/dist/write/store/heartbeat.js +65 -0
- package/dist/write/store/ledger.d.ts +15 -0
- package/dist/write/store/ledger.js +86 -0
- package/dist/write/store/lifecycle.d.ts +35 -0
- package/dist/write/store/lifecycle.js +114 -0
- package/dist/write/store/lock.d.ts +97 -0
- package/dist/write/store/lock.js +464 -0
- package/dist/write/store/op-lock.d.ts +13 -0
- package/dist/write/store/op-lock.js +175 -0
- package/dist/write/store/plan-store.d.ts +7 -0
- package/dist/write/store/plan-store.js +48 -0
- package/dist/write/store/plans.d.ts +5 -0
- package/dist/write/store/plans.js +19 -0
- package/dist/write/store/types.d.ts +195 -0
- package/dist/write/store/types.js +2 -0
- package/dist/write/store.d.ts +6 -0
- package/dist/write/store.js +182 -0
- package/examples/agentgateway.write-gate.yaml +29 -0
- package/package.json +71 -0
- package/server.json +69 -0
- package/skills/ar-aging.md +65 -0
- package/skills/company-360.md +69 -0
- package/skills/contract-profitability.md +65 -0
- package/skills/crm-management.md +87 -0
- package/skills/filter-semantics.md +75 -0
- package/skills/invoice-export.md +61 -0
- package/skills/log-time-entry.md +77 -0
- package/skills/non-chargeable-work.md +67 -0
- package/skills/portfolio-margin.md +66 -0
- package/skills/recurring-revenue.md +65 -0
- package/skills/revenue-rollup.md +65 -0
- package/skills/slim-reads.md +67 -0
- package/skills/ticket-triage.md +64 -0
- package/skills/unbilled-work-review.md +66 -0
- package/skills/wip-hours.md +68 -0
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.4.0",
|
|
3
|
+
"domain": "autotask",
|
|
4
|
+
"description": "Machine-readable capability catalogue for iit-mcp-autotask: the tools the server can serve, with the toolset and the lowest profile that serves each. Everything else in the registry is reachable through the generic layer (autotask_catalog / autotask_describe / autotask_read) and documented in docs/capability-matrix.md. Generated from src/tools/surface.ts by scripts/build-capabilities.mjs.",
|
|
5
|
+
"exposedToolCount": {
|
|
6
|
+
"readonlyCore": 10,
|
|
7
|
+
"readonlyAll": 23,
|
|
8
|
+
"operatorCore": 13,
|
|
9
|
+
"operatorAll": 26
|
|
10
|
+
},
|
|
11
|
+
"profiles": {
|
|
12
|
+
"readonly": {
|
|
13
|
+
"note": "Reads only. The default."
|
|
14
|
+
},
|
|
15
|
+
"operator": {
|
|
16
|
+
"note": "Adds the operator toolset (preview with autotask_write; execute with autotask_apply, or autotask_apply_destructive for a plan that hits a hard rule)."
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"toolsets": {
|
|
20
|
+
"core": [
|
|
21
|
+
"autotask_guide",
|
|
22
|
+
"autotask_catalog",
|
|
23
|
+
"autotask_describe",
|
|
24
|
+
"autotask_read",
|
|
25
|
+
"autotask_resolve",
|
|
26
|
+
"autotask_query",
|
|
27
|
+
"autotask_tenant_status",
|
|
28
|
+
"autotask_ticket_full_context",
|
|
29
|
+
"autotask_company_full_profile",
|
|
30
|
+
"autotask_resource_workload"
|
|
31
|
+
],
|
|
32
|
+
"service": [
|
|
33
|
+
"autotask_project_get_context",
|
|
34
|
+
"autotask_service_call_full_profile"
|
|
35
|
+
],
|
|
36
|
+
"records": [
|
|
37
|
+
"autotask_contact_full_profile",
|
|
38
|
+
"autotask_configuration_item_profile",
|
|
39
|
+
"autotask_contract_full_profile"
|
|
40
|
+
],
|
|
41
|
+
"finance": [
|
|
42
|
+
"autotask_quote_get",
|
|
43
|
+
"autotask_invoice_get",
|
|
44
|
+
"autotask_revenue_rollup",
|
|
45
|
+
"autotask_portfolio_margin",
|
|
46
|
+
"autotask_recurring_revenue",
|
|
47
|
+
"autotask_ar_aging",
|
|
48
|
+
"autotask_wip_hours",
|
|
49
|
+
"autotask_non_chargeable_work"
|
|
50
|
+
],
|
|
51
|
+
"operator": [
|
|
52
|
+
"autotask_write",
|
|
53
|
+
"autotask_apply",
|
|
54
|
+
"autotask_apply_destructive"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"naming": "Tool names are snake_case, autotask_-prefixed (0.6.0 dropped the SDK manifest names: merged tools have no single manifest name). Writes preview through autotask_write and execute through autotask_apply, or autotask_apply_destructive when the plan hits a hard rule (deletes, webhook writes, approval-required ops, and moves that change company or contract); destructive operations preview through autotask_write too (deviation D-12).",
|
|
58
|
+
"capabilities": [
|
|
59
|
+
{
|
|
60
|
+
"id": "autotask.platform.guide",
|
|
61
|
+
"description": "Step-by-step playbooks for multi-step Autotask tasks. No args: the index; {skill} returns one playbook, {skill, section} one section. Static text, no vendor call. Use it first when a task needs several tools.",
|
|
62
|
+
"mcpPrimitive": "tool",
|
|
63
|
+
"toolName": "autotask_guide",
|
|
64
|
+
"type": "read",
|
|
65
|
+
"toolset": "core",
|
|
66
|
+
"profile": "readonly",
|
|
67
|
+
"backingOperation": "packaged skills/*.md (static)",
|
|
68
|
+
"annotations": {
|
|
69
|
+
"readOnly": true,
|
|
70
|
+
"idempotent": true,
|
|
71
|
+
"destructive": false,
|
|
72
|
+
"openWorld": false
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "autotask.platform.catalog",
|
|
77
|
+
"description": "Find the exact operation key for anything without a dedicated tool: ranked search (q) over the 1,229 registry operations, with effect and whether this deployment serves it. No vendor call.",
|
|
78
|
+
"mcpPrimitive": "tool",
|
|
79
|
+
"toolName": "autotask_catalog",
|
|
80
|
+
"type": "read",
|
|
81
|
+
"toolset": "core",
|
|
82
|
+
"profile": "readonly",
|
|
83
|
+
"backingOperation": "node-autotask/capabilities registry + MCP_TOOL_CATALOG.json",
|
|
84
|
+
"annotations": {
|
|
85
|
+
"readOnly": true,
|
|
86
|
+
"idempotent": true,
|
|
87
|
+
"destructive": false,
|
|
88
|
+
"openWorld": false
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "autotask.platform.describe",
|
|
93
|
+
"description": "One operation's (registry key or tool name) exact input/output contract, examples, errors, policy verdict and playbooks (operation), or one resource's relationship map: parent, children, lookup keys (resource). No vendor call.",
|
|
94
|
+
"mcpPrimitive": "tool",
|
|
95
|
+
"toolName": "autotask_describe",
|
|
96
|
+
"type": "read",
|
|
97
|
+
"toolset": "core",
|
|
98
|
+
"profile": "readonly",
|
|
99
|
+
"backingOperation": "registry records + operations.relationshipMap",
|
|
100
|
+
"annotations": {
|
|
101
|
+
"readOnly": true,
|
|
102
|
+
"idempotent": true,
|
|
103
|
+
"destructive": false,
|
|
104
|
+
"openWorld": false
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "autotask.generic.read",
|
|
109
|
+
"description": "Run one or several reads in one call by exact registry key: unbilled work, profitability and margin, SLA health. Scope by company/contract ids (unscoped = tenant walk); totals: autotask_query group_by; slim: includeFields, noteChars.",
|
|
110
|
+
"mcpPrimitive": "tool",
|
|
111
|
+
"toolName": "autotask_read",
|
|
112
|
+
"type": "read",
|
|
113
|
+
"toolset": "core",
|
|
114
|
+
"profile": "readonly",
|
|
115
|
+
"backingOperation": "node-autotask/operations invokeRead (any effect=read key)",
|
|
116
|
+
"annotations": {
|
|
117
|
+
"readOnly": true,
|
|
118
|
+
"idempotent": true,
|
|
119
|
+
"destructive": false,
|
|
120
|
+
"openWorld": true
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "autotask.discovery.resolve",
|
|
125
|
+
"description": "Find the record for an identifier: id or name, ticket number, CI serial, contact email (by), staff by email, user name or name (resource resources, include_api_users); one resource or a sweep. Exact, then contains on a miss.",
|
|
126
|
+
"mcpPrimitive": "tool",
|
|
127
|
+
"toolName": "autotask_resolve",
|
|
128
|
+
"type": "read",
|
|
129
|
+
"toolset": "core",
|
|
130
|
+
"profile": "readonly",
|
|
131
|
+
"backingOperation": "operations.resolveAny | operations.resolveStaff | operations.searchAcrossResources | companies.resolve | companies.search | configuration_items.resolve | contacts.resolve | projects.resolve | tickets.resolve | tickets.findByTicketNumber | configuration_items.findBySerial | contacts.findByEmail | tickets.search | resources.query | resources.get | operations.fieldCatalog",
|
|
132
|
+
"annotations": {
|
|
133
|
+
"readOnly": true,
|
|
134
|
+
"idempotent": true,
|
|
135
|
+
"destructive": false,
|
|
136
|
+
"openWorld": true
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"id": "autotask.discovery.query",
|
|
141
|
+
"description": "List records or totals with a filter: tickets, time entries, service calls, contracts, time off, more. Totals, no rows: group_by, sum, count (hours logged by ticket, how many match). By id: id in. Scope by company ids (unscoped = tenant walk).",
|
|
142
|
+
"mcpPrimitive": "tool",
|
|
143
|
+
"toolName": "autotask_query",
|
|
144
|
+
"type": "read",
|
|
145
|
+
"toolset": "core",
|
|
146
|
+
"profile": "readonly",
|
|
147
|
+
"backingOperation": "tickets.query | time_entries.query | service_calls.query | contracts.query | time_off_requests.query | operations.aggregate",
|
|
148
|
+
"annotations": {
|
|
149
|
+
"readOnly": true,
|
|
150
|
+
"idempotent": true,
|
|
151
|
+
"destructive": false,
|
|
152
|
+
"openWorld": true
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": "autotask.identity.tenant_status",
|
|
157
|
+
"description": "Identity (API user + impersonated user), Autotask API version, this server's package/SDK version and profile (server), request thresholds, and the time zone of the people asking, with local and UTC time (time). Use it first to check credentials.",
|
|
158
|
+
"mcpPrimitive": "tool",
|
|
159
|
+
"toolName": "autotask_tenant_status",
|
|
160
|
+
"type": "read",
|
|
161
|
+
"toolset": "core",
|
|
162
|
+
"profile": "readonly",
|
|
163
|
+
"backingOperation": "resources.whoAmI | version.get | threshold_information.get",
|
|
164
|
+
"annotations": {
|
|
165
|
+
"readOnly": true,
|
|
166
|
+
"idempotent": true,
|
|
167
|
+
"destructive": false,
|
|
168
|
+
"openWorld": true
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "autotask.ticket.full_context",
|
|
173
|
+
"description": "One ticket with its company, contact, assigned resource, project, notes, time entries and attachment metadata. Missing parts degrade to typed absent; a missing ticket is not found.",
|
|
174
|
+
"mcpPrimitive": "tool",
|
|
175
|
+
"toolName": "autotask_ticket_full_context",
|
|
176
|
+
"type": "read",
|
|
177
|
+
"toolset": "core",
|
|
178
|
+
"profile": "readonly",
|
|
179
|
+
"backingOperation": "tickets.fullContext",
|
|
180
|
+
"annotations": {
|
|
181
|
+
"readOnly": true,
|
|
182
|
+
"idempotent": true,
|
|
183
|
+
"destructive": false,
|
|
184
|
+
"openWorld": true
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"id": "autotask.company.full_profile",
|
|
189
|
+
"description": "One company with locations, contacts, notes, open tickets and projects (capped: true = more exist; raise the limit). fields {part:[names]} trims columns. Open = not tenant-closed. Missing parts degrade to typed absent.",
|
|
190
|
+
"mcpPrimitive": "tool",
|
|
191
|
+
"toolName": "autotask_company_full_profile",
|
|
192
|
+
"type": "read",
|
|
193
|
+
"toolset": "core",
|
|
194
|
+
"profile": "readonly",
|
|
195
|
+
"backingOperation": "companies.fullProfile",
|
|
196
|
+
"annotations": {
|
|
197
|
+
"readOnly": true,
|
|
198
|
+
"idempotent": true,
|
|
199
|
+
"destructive": false,
|
|
200
|
+
"openWorld": true
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"id": "autotask.resource.workload",
|
|
205
|
+
"description": "A resource's open tickets (primary or secondary, de-duplicated), assignments, time off. For \"how many\" use totals (exact; capped = link cap hit, not row capped; extra reads; totalsAbsent = failed). Missing parts: typed absent.",
|
|
206
|
+
"mcpPrimitive": "tool",
|
|
207
|
+
"toolName": "autotask_resource_workload",
|
|
208
|
+
"type": "read",
|
|
209
|
+
"toolset": "core",
|
|
210
|
+
"profile": "readonly",
|
|
211
|
+
"backingOperation": "resources.workload",
|
|
212
|
+
"annotations": {
|
|
213
|
+
"readOnly": true,
|
|
214
|
+
"idempotent": true,
|
|
215
|
+
"destructive": false,
|
|
216
|
+
"openWorld": true
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"id": "autotask.project.get_context",
|
|
221
|
+
"description": "One project with its company, opportunity, lead resource, phases (a tree) and tasks (first 100 phases, 200 tasks; count is exact, truncated = more exist). Charges and notes: autotask_read.",
|
|
222
|
+
"mcpPrimitive": "tool",
|
|
223
|
+
"toolName": "autotask_project_get_context",
|
|
224
|
+
"type": "read",
|
|
225
|
+
"toolset": "service",
|
|
226
|
+
"profile": "readonly",
|
|
227
|
+
"backingOperation": "projects.getContext",
|
|
228
|
+
"annotations": {
|
|
229
|
+
"readOnly": true,
|
|
230
|
+
"idempotent": true,
|
|
231
|
+
"destructive": false,
|
|
232
|
+
"openWorld": true
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"id": "autotask.service_call.full_profile",
|
|
237
|
+
"description": "One service call with its linked tickets, tasks and resource assignments, for on-site visit work. Missing parts degrade to typed absent.",
|
|
238
|
+
"mcpPrimitive": "tool",
|
|
239
|
+
"toolName": "autotask_service_call_full_profile",
|
|
240
|
+
"type": "read",
|
|
241
|
+
"toolset": "service",
|
|
242
|
+
"profile": "readonly",
|
|
243
|
+
"backingOperation": "service_calls.fullProfile",
|
|
244
|
+
"annotations": {
|
|
245
|
+
"readOnly": true,
|
|
246
|
+
"idempotent": true,
|
|
247
|
+
"destructive": false,
|
|
248
|
+
"openWorld": true
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"id": "autotask.contact.full_profile",
|
|
253
|
+
"description": "One contact with their company and open tickets (closed set from the tenant status picklist). Contains personal data. Missing parts degrade to typed absent.",
|
|
254
|
+
"mcpPrimitive": "tool",
|
|
255
|
+
"toolName": "autotask_contact_full_profile",
|
|
256
|
+
"type": "read",
|
|
257
|
+
"toolset": "records",
|
|
258
|
+
"profile": "readonly",
|
|
259
|
+
"backingOperation": "contacts.fullProfile",
|
|
260
|
+
"annotations": {
|
|
261
|
+
"readOnly": true,
|
|
262
|
+
"idempotent": true,
|
|
263
|
+
"destructive": false,
|
|
264
|
+
"openWorld": true
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"id": "autotask.configuration_item.profile",
|
|
269
|
+
"description": "One configuration item with type, category, notes, related items and billing products. Zone ww29 has no configuration items: expect not found there.",
|
|
270
|
+
"mcpPrimitive": "tool",
|
|
271
|
+
"toolName": "autotask_configuration_item_profile",
|
|
272
|
+
"type": "read",
|
|
273
|
+
"toolset": "records",
|
|
274
|
+
"profile": "readonly",
|
|
275
|
+
"backingOperation": "configuration_items.profile",
|
|
276
|
+
"annotations": {
|
|
277
|
+
"readOnly": true,
|
|
278
|
+
"idempotent": true,
|
|
279
|
+
"destructive": false,
|
|
280
|
+
"openWorld": true
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"id": "autotask.contract.full_profile",
|
|
285
|
+
"description": "One contract with services, billing rules, newest charges and service units. Monthly P&L: autotask_read (guide: contract-profitability).",
|
|
286
|
+
"mcpPrimitive": "tool",
|
|
287
|
+
"toolName": "autotask_contract_full_profile",
|
|
288
|
+
"type": "read",
|
|
289
|
+
"toolset": "records",
|
|
290
|
+
"profile": "readonly",
|
|
291
|
+
"backingOperation": "contracts.fullProfile",
|
|
292
|
+
"annotations": {
|
|
293
|
+
"readOnly": true,
|
|
294
|
+
"idempotent": true,
|
|
295
|
+
"destructive": false,
|
|
296
|
+
"openWorld": true
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"id": "autotask.quote.get",
|
|
301
|
+
"description": "One quote with its line items in one call. A list of quotes: autotask_read quotes.query.",
|
|
302
|
+
"mcpPrimitive": "tool",
|
|
303
|
+
"toolName": "autotask_quote_get",
|
|
304
|
+
"type": "read",
|
|
305
|
+
"toolset": "finance",
|
|
306
|
+
"profile": "readonly",
|
|
307
|
+
"backingOperation": "quotes.withItems",
|
|
308
|
+
"annotations": {
|
|
309
|
+
"readOnly": true,
|
|
310
|
+
"idempotent": true,
|
|
311
|
+
"destructive": false,
|
|
312
|
+
"openWorld": true
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"id": "autotask.invoice.get",
|
|
317
|
+
"description": "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.",
|
|
318
|
+
"mcpPrimitive": "tool",
|
|
319
|
+
"toolName": "autotask_invoice_get",
|
|
320
|
+
"type": "read",
|
|
321
|
+
"toolset": "finance",
|
|
322
|
+
"profile": "readonly",
|
|
323
|
+
"backingOperation": "invoices.get | invoices.markupHtml | invoices.markupXml | invoices.pdf",
|
|
324
|
+
"annotations": {
|
|
325
|
+
"readOnly": true,
|
|
326
|
+
"idempotent": true,
|
|
327
|
+
"destructive": false,
|
|
328
|
+
"openWorld": true
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"id": "autotask.finance.revenue_rollup",
|
|
333
|
+
"description": "Revenue for recurring and fixed price contracts by vertical, company or month, with excluded amounts and coverage. One scope required; full-month windows in the user zone. May take 15-45 seconds. Finance playbook: revenue-rollup.",
|
|
334
|
+
"mcpPrimitive": "tool",
|
|
335
|
+
"toolName": "autotask_revenue_rollup",
|
|
336
|
+
"type": "read",
|
|
337
|
+
"toolset": "finance",
|
|
338
|
+
"profile": "readonly",
|
|
339
|
+
"backingOperation": "operations.revenueRollup",
|
|
340
|
+
"annotations": {
|
|
341
|
+
"readOnly": true,
|
|
342
|
+
"idempotent": true,
|
|
343
|
+
"destructive": false,
|
|
344
|
+
"openWorld": true
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"id": "autotask.finance.portfolio_margin",
|
|
349
|
+
"description": "Contract profit and margin by contract type, contract, company, vertical or month, with per-contract coverage gaps. One scope required; full-month windows in the user zone. May take minutes. Finance playbook: portfolio-margin.",
|
|
350
|
+
"mcpPrimitive": "tool",
|
|
351
|
+
"toolName": "autotask_portfolio_margin",
|
|
352
|
+
"type": "read",
|
|
353
|
+
"toolset": "finance",
|
|
354
|
+
"profile": "readonly",
|
|
355
|
+
"backingOperation": "operations.portfolioMargin",
|
|
356
|
+
"annotations": {
|
|
357
|
+
"readOnly": true,
|
|
358
|
+
"idempotent": true,
|
|
359
|
+
"destructive": false,
|
|
360
|
+
"openWorld": true
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"id": "autotask.finance.recurring_revenue",
|
|
365
|
+
"description": "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.",
|
|
366
|
+
"mcpPrimitive": "tool",
|
|
367
|
+
"toolName": "autotask_recurring_revenue",
|
|
368
|
+
"type": "read",
|
|
369
|
+
"toolset": "finance",
|
|
370
|
+
"profile": "readonly",
|
|
371
|
+
"backingOperation": "operations.recurringRevenue",
|
|
372
|
+
"annotations": {
|
|
373
|
+
"readOnly": true,
|
|
374
|
+
"idempotent": true,
|
|
375
|
+
"destructive": false,
|
|
376
|
+
"openWorld": true
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"id": "autotask.finance.ar_aging",
|
|
381
|
+
"description": "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.",
|
|
382
|
+
"mcpPrimitive": "tool",
|
|
383
|
+
"toolName": "autotask_ar_aging",
|
|
384
|
+
"type": "read",
|
|
385
|
+
"toolset": "finance",
|
|
386
|
+
"profile": "readonly",
|
|
387
|
+
"backingOperation": "operations.arAging",
|
|
388
|
+
"annotations": {
|
|
389
|
+
"readOnly": true,
|
|
390
|
+
"idempotent": true,
|
|
391
|
+
"destructive": false,
|
|
392
|
+
"openWorld": true
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"id": "autotask.finance.wip_hours",
|
|
397
|
+
"description": "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.",
|
|
398
|
+
"mcpPrimitive": "tool",
|
|
399
|
+
"toolName": "autotask_wip_hours",
|
|
400
|
+
"type": "read",
|
|
401
|
+
"toolset": "finance",
|
|
402
|
+
"profile": "readonly",
|
|
403
|
+
"backingOperation": "operations.wipHours",
|
|
404
|
+
"annotations": {
|
|
405
|
+
"readOnly": true,
|
|
406
|
+
"idempotent": true,
|
|
407
|
+
"destructive": false,
|
|
408
|
+
"openWorld": true
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
{
|
|
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.",
|
|
414
|
+
"mcpPrimitive": "tool",
|
|
415
|
+
"toolName": "autotask_non_chargeable_work",
|
|
416
|
+
"type": "read",
|
|
417
|
+
"toolset": "finance",
|
|
418
|
+
"profile": "readonly",
|
|
419
|
+
"backingOperation": "operations.nonChargeableWork",
|
|
420
|
+
"annotations": {
|
|
421
|
+
"readOnly": true,
|
|
422
|
+
"idempotent": true,
|
|
423
|
+
"destructive": false,
|
|
424
|
+
"openWorld": true
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"id": "autotask.generic.write",
|
|
429
|
+
"description": "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.",
|
|
430
|
+
"mcpPrimitive": "tool",
|
|
431
|
+
"toolName": "autotask_write",
|
|
432
|
+
"type": "write",
|
|
433
|
+
"toolset": "operator",
|
|
434
|
+
"profile": "operator",
|
|
435
|
+
"backingOperation": "node-autotask/operations invokeWrite / invokeDelete dry run (the keys AUTOTASK_WRITE lists)",
|
|
436
|
+
"annotations": {
|
|
437
|
+
"readOnly": true,
|
|
438
|
+
"idempotent": true,
|
|
439
|
+
"destructive": false,
|
|
440
|
+
"openWorld": true
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"id": "autotask.generic.apply",
|
|
445
|
+
"description": "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.",
|
|
446
|
+
"mcpPrimitive": "tool",
|
|
447
|
+
"toolName": "autotask_apply",
|
|
448
|
+
"type": "write",
|
|
449
|
+
"toolset": "operator",
|
|
450
|
+
"profile": "operator",
|
|
451
|
+
"backingOperation": "node-autotask/operations invokeWrite / invokeDelete (exactly the previewed plan, no hard rule)",
|
|
452
|
+
"annotations": {
|
|
453
|
+
"readOnly": false,
|
|
454
|
+
"idempotent": true,
|
|
455
|
+
"destructive": true,
|
|
456
|
+
"openWorld": true
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"id": "autotask.generic.apply_destructive",
|
|
461
|
+
"description": "Execute one previewed plan whose preview names this tool: deletes, webhook writes, sensitive or approval-required operations, company or contract moves. Same arguments as autotask_apply: plan, operation, targets, summary verbatim from the preview.",
|
|
462
|
+
"mcpPrimitive": "tool",
|
|
463
|
+
"toolName": "autotask_apply_destructive",
|
|
464
|
+
"type": "write",
|
|
465
|
+
"toolset": "operator",
|
|
466
|
+
"profile": "operator",
|
|
467
|
+
"backingOperation": "node-autotask/operations invokeWrite / invokeDelete (exactly the previewed plan that hits a hard rule)",
|
|
468
|
+
"annotations": {
|
|
469
|
+
"readOnly": false,
|
|
470
|
+
"idempotent": true,
|
|
471
|
+
"destructive": true,
|
|
472
|
+
"openWorld": true
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
],
|
|
476
|
+
"genericCapabilityLayer": {
|
|
477
|
+
"enabled": true,
|
|
478
|
+
"tools": [
|
|
479
|
+
"autotask_catalog",
|
|
480
|
+
"autotask_describe",
|
|
481
|
+
"autotask_read"
|
|
482
|
+
],
|
|
483
|
+
"backingRegistryOperations": 1229,
|
|
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
|
+
},
|
|
486
|
+
"schemas": {}
|
|
487
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ClientCapabilities, type InputRequiredResult } from '@modelcontextprotocol/server';
|
|
2
|
+
import { type ToolReturn } from '../tools/results/envelope.js';
|
|
3
|
+
import type { Confirmation } from '../tools/write/apply.js';
|
|
4
|
+
import type { PlanRecord } from '../write/store.js';
|
|
5
|
+
import { type Remember } from './grants.js';
|
|
6
|
+
/** The key the confirm form's answer rides under in `inputResponses`. */
|
|
7
|
+
export declare const GATE_KEY = "confirm";
|
|
8
|
+
export type Caller = {
|
|
9
|
+
transport: 'stdio';
|
|
10
|
+
} | {
|
|
11
|
+
transport: 'http';
|
|
12
|
+
clientId?: string;
|
|
13
|
+
};
|
|
14
|
+
export type GateOutcome = {
|
|
15
|
+
ok: Confirmation;
|
|
16
|
+
remember: Remember;
|
|
17
|
+
} | {
|
|
18
|
+
result: ToolReturn | InputRequiredResult;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* What the person reads (#301): the SDK's `describeWrite` headline and field lines stored at preview
|
|
22
|
+
* (already cleaned, quoted and capped; no vendor call here), reversibility, the stated reason, the plan
|
|
23
|
+
* and its expiry, then the data fenced as untrusted and capped.
|
|
24
|
+
*/
|
|
25
|
+
export declare function gateMessage(plan: PlanRecord): string;
|
|
26
|
+
/** Whether the calling client can show a form-mode elicitation. An empty `elicitation: {}` declares form mode. */
|
|
27
|
+
export declare function formElicitation(extra: unknown, caller: Caller, legacyCaps: ClientCapabilities | undefined): boolean;
|
|
28
|
+
/** Decide one gated plan's apply: a confirmation, the confirm form, or a typed deny. Zero vendor calls on every path. */
|
|
29
|
+
export declare function gateApply(a: {
|
|
30
|
+
plan: PlanRecord;
|
|
31
|
+
caller: Caller;
|
|
32
|
+
extra: unknown;
|
|
33
|
+
legacyCaps: ClientCapabilities | undefined;
|
|
34
|
+
}): GateOutcome;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** Apply-time human confirmation through MCP form elicitation (stdio only, #302); unsupported clients fail closed. */
|
|
2
|
+
import * as z from 'zod';
|
|
3
|
+
import { inputRequired } from '@modelcontextprotocol/server';
|
|
4
|
+
import { cleanUntrustedText } from '../tools/results/untrusted.js';
|
|
5
|
+
import {} from '../tools/results/envelope.js';
|
|
6
|
+
import { answer, reason } from '../tools/write/common.js';
|
|
7
|
+
import { REMEMBER } from './grants.js';
|
|
8
|
+
/** The key the confirm form's answer rides under in `inputResponses`. */
|
|
9
|
+
export const GATE_KEY = 'confirm';
|
|
10
|
+
/** The form's one field (#302): what the accept covers for the rest of this session. */
|
|
11
|
+
const FORM = z.object({
|
|
12
|
+
remember: z.enum(REMEMBER).default('once').describe('once: this write only. operation: every later write of this operation this session. all: every write that needs confirmation this session.'),
|
|
13
|
+
});
|
|
14
|
+
const DATA_CAP = 500;
|
|
15
|
+
/** The plan's data for the fence: unsafe characters stripped, capped (never splitting a surrogate pair), angle brackets escaped. */
|
|
16
|
+
function fencedData(args) {
|
|
17
|
+
const clean = cleanUntrustedText(JSON.stringify(args), false);
|
|
18
|
+
let cut = clean.slice(0, DATA_CAP);
|
|
19
|
+
if (/[\uD800-\uDBFF]$/.test(cut))
|
|
20
|
+
cut = cut.slice(0, -1);
|
|
21
|
+
const escaped = cut.replace(/</g, '<').replace(/>/g, '>');
|
|
22
|
+
return cut.length < clean.length ? `${escaped} [truncated ${clean.length - cut.length} chars — full payload not shown]` : escaped;
|
|
23
|
+
}
|
|
24
|
+
/** Server text quoted for the form: one JSON string, angle brackets escaped (it cannot break a line or pose as a fence). */
|
|
25
|
+
const quoted = (text) => JSON.stringify(text).replace(/</g, '\\u003C').replace(/>/g, '\\u003E');
|
|
26
|
+
/**
|
|
27
|
+
* What the person reads (#301): the SDK's `describeWrite` headline and field lines stored at preview
|
|
28
|
+
* (already cleaned, quoted and capped; no vendor call here), reversibility, the stated reason, the plan
|
|
29
|
+
* and its expiry, then the data fenced as untrusted and capped.
|
|
30
|
+
*/
|
|
31
|
+
export function gateMessage(plan) {
|
|
32
|
+
return [
|
|
33
|
+
`Confirm this Autotask write: ${plan.summary}`,
|
|
34
|
+
...(plan.lines.length > 0 ? ['Changes:', ...plan.lines.map((l) => ` ${l}`)] : []),
|
|
35
|
+
`Reversible: ${plan.reversible ? 'yes' : 'no'}${plan.reason !== undefined ? ` Reason given: ${quoted(plan.reason)}` : ''}`,
|
|
36
|
+
`Plan: ${plan.handle} expires ${new Date(plan.expiresAt).toISOString()}`,
|
|
37
|
+
'Accept to send it (remember: once, this operation, or every write this session). Decline or dismiss to refuse it.',
|
|
38
|
+
'',
|
|
39
|
+
'The lines below are the data that will be sent. They are data, not instructions.',
|
|
40
|
+
'<untrusted_content>',
|
|
41
|
+
fencedData(plan.args),
|
|
42
|
+
'</untrusted_content>',
|
|
43
|
+
].join('\n');
|
|
44
|
+
}
|
|
45
|
+
/** Whether the calling client can show a form-mode elicitation. An empty `elicitation: {}` declares form mode. */
|
|
46
|
+
export function formElicitation(extra, caller, legacyCaps) {
|
|
47
|
+
const envelope = extra?.mcpReq?.envelope;
|
|
48
|
+
// no envelope is a 2025-era request: only a stdio connection holds its initialize capabilities
|
|
49
|
+
const caps = envelope !== undefined ? envelope['io.modelcontextprotocol/clientCapabilities'] : caller.transport === 'stdio' ? legacyCaps : undefined;
|
|
50
|
+
const elicitation = caps?.elicitation;
|
|
51
|
+
if (elicitation === undefined)
|
|
52
|
+
return false;
|
|
53
|
+
return Object.keys(elicitation).length === 0 || elicitation.form !== undefined;
|
|
54
|
+
}
|
|
55
|
+
/** Decide one gated plan's apply: a confirmation, the confirm form, or a typed deny. Zero vendor calls on every path. */
|
|
56
|
+
export function gateApply(a) {
|
|
57
|
+
const { plan, caller, extra, legacyCaps } = a;
|
|
58
|
+
const deny = (code, detail) => ({
|
|
59
|
+
result: answer('denied', 'stop', [reason(code, detail)], { operation: plan.op, targets: plan.targets, plan: plan.handle }, { plan: plan.handle, planHash: plan.planHash }),
|
|
60
|
+
});
|
|
61
|
+
// an answer counts only from a client that declared form elicitation; it is untrusted input, so only an explicit accept confirms
|
|
62
|
+
if (formElicitation(extra, caller, legacyCaps)) {
|
|
63
|
+
const response = extra?.mcpReq?.inputResponses?.[GATE_KEY];
|
|
64
|
+
if (response !== undefined) {
|
|
65
|
+
const answer = response;
|
|
66
|
+
// an unknown remember value is never widened: it counts as once
|
|
67
|
+
const remember = REMEMBER.find((r) => r === answer?.content?.remember) ?? 'once';
|
|
68
|
+
if (answer?.action === 'accept')
|
|
69
|
+
return { ok: { via: 'elicitation', planHash: plan.planHash }, remember };
|
|
70
|
+
return deny('GATE_DECLINED', `the person declined or dismissed ${plan.op}; nothing was sent`);
|
|
71
|
+
}
|
|
72
|
+
return { result: inputRequired({ inputRequests: { [GATE_KEY]: inputRequired.elicit({ message: gateMessage(plan), requestedSchema: FORM }) } }) };
|
|
73
|
+
}
|
|
74
|
+
return deny('GATE_UNSUPPORTED', `${plan.op} needs a person to confirm it, and this client cannot show a confirm form; nothing was sent`);
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=gate.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** The owner's bound on one grant (2026-11-03): a working day. */
|
|
2
|
+
export declare const GRANT_TTL_MS: number;
|
|
3
|
+
export declare const REMEMBER: readonly ["once", "operation", "all"];
|
|
4
|
+
export type Remember = (typeof REMEMBER)[number];
|
|
5
|
+
export interface GrantKey {
|
|
6
|
+
principal: string;
|
|
7
|
+
tenantId: string;
|
|
8
|
+
policyHash: string;
|
|
9
|
+
op: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class SessionGrants {
|
|
12
|
+
private readonly ttlMs;
|
|
13
|
+
private grants;
|
|
14
|
+
constructor(ttlMs?: number);
|
|
15
|
+
/** The id of a live grant covering this write (expired grants are dropped first). */
|
|
16
|
+
match(k: GrantKey, now: number): string | undefined;
|
|
17
|
+
/** Record what the person chose in the form; `once` records nothing. */
|
|
18
|
+
add(k: GrantKey, remember: Remember, now: number): string | undefined;
|
|
19
|
+
clear(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* access/grants.ts — stdio "remember for this session" grants (#302). In memory only, never persisted:
|
|
3
|
+
* on stdio a session is the server process, so a grant ends with it, after {@link GRANT_TTL_MS}, on any policy
|
|
4
|
+
* change (the policy hash is part of the key), or when the kill file is created, changed or removed (#311; the
|
|
5
|
+
* store's `onKill`), whether or not a write runs meanwhile. Keyed by principal, tenant, policy hash
|
|
6
|
+
* and scope (one operation key or `*`); never by a client-asserted id.
|
|
7
|
+
*/
|
|
8
|
+
import { randomBytes } from 'node:crypto';
|
|
9
|
+
/** The owner's bound on one grant (2026-11-03): a working day. */
|
|
10
|
+
export const GRANT_TTL_MS = 8 * 60 * 60_000;
|
|
11
|
+
export const REMEMBER = ['once', 'operation', 'all'];
|
|
12
|
+
export class SessionGrants {
|
|
13
|
+
ttlMs;
|
|
14
|
+
grants = [];
|
|
15
|
+
constructor(ttlMs = GRANT_TTL_MS) {
|
|
16
|
+
this.ttlMs = ttlMs;
|
|
17
|
+
}
|
|
18
|
+
/** The id of a live grant covering this write (expired grants are dropped first). */
|
|
19
|
+
match(k, now) {
|
|
20
|
+
this.grants = this.grants.filter((g) => g.expiresAt > now);
|
|
21
|
+
return this.grants.find((g) => g.principal === k.principal && g.tenantId === k.tenantId && g.policyHash === k.policyHash && (g.scope === '*' || g.scope === k.op))?.id;
|
|
22
|
+
}
|
|
23
|
+
/** Record what the person chose in the form; `once` records nothing. */
|
|
24
|
+
add(k, remember, now) {
|
|
25
|
+
if (remember === 'once')
|
|
26
|
+
return undefined;
|
|
27
|
+
const id = `grt_${randomBytes(8).toString('hex')}`;
|
|
28
|
+
this.grants.push({ id, principal: k.principal, tenantId: k.tenantId, policyHash: k.policyHash, scope: remember === 'all' ? '*' : k.op, expiresAt: now + this.ttlMs });
|
|
29
|
+
return id;
|
|
30
|
+
}
|
|
31
|
+
clear() {
|
|
32
|
+
this.grants = [];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=grants.js.map
|