@burdenoff/mcp-libs 2026.627.2 → 2026.627.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/dist/modules/artistrybase/index.cjs +2112 -0
- package/dist/modules/artistrybase/index.cjs.map +1 -0
- package/dist/modules/artistrybase/index.d.cts +8 -0
- package/dist/modules/artistrybase/index.d.ts +8 -0
- package/dist/modules/artistrybase/index.js +2051 -0
- package/dist/modules/artistrybase/index.js.map +1 -0
- package/dist/modules/brainyrich/index.cjs +2148 -0
- package/dist/modules/brainyrich/index.cjs.map +1 -0
- package/dist/modules/brainyrich/index.d.cts +8 -0
- package/dist/modules/brainyrich/index.d.ts +8 -0
- package/dist/modules/brainyrich/index.js +2087 -0
- package/dist/modules/brainyrich/index.js.map +1 -0
- package/dist/modules/buildmyiq/index.cjs +1562 -0
- package/dist/modules/buildmyiq/index.cjs.map +1 -0
- package/dist/modules/buildmyiq/index.d.cts +8 -0
- package/dist/modules/buildmyiq/index.d.ts +8 -0
- package/dist/modules/buildmyiq/index.js +1501 -0
- package/dist/modules/buildmyiq/index.js.map +1 -0
- package/dist/modules/collabkin/index.cjs +1577 -0
- package/dist/modules/collabkin/index.cjs.map +1 -0
- package/dist/modules/collabkin/index.d.cts +8 -0
- package/dist/modules/collabkin/index.d.ts +8 -0
- package/dist/modules/collabkin/index.js +1516 -0
- package/dist/modules/collabkin/index.js.map +1 -0
- package/dist/modules/comradecircle/index.cjs +1817 -0
- package/dist/modules/comradecircle/index.cjs.map +1 -0
- package/dist/modules/comradecircle/index.d.cts +8 -0
- package/dist/modules/comradecircle/index.d.ts +8 -0
- package/dist/modules/comradecircle/index.js +1756 -0
- package/dist/modules/comradecircle/index.js.map +1 -0
- package/dist/modules/cosmicintersection/index.cjs +1984 -0
- package/dist/modules/cosmicintersection/index.cjs.map +1 -0
- package/dist/modules/cosmicintersection/index.d.cts +8 -0
- package/dist/modules/cosmicintersection/index.d.ts +8 -0
- package/dist/modules/cosmicintersection/index.js +1923 -0
- package/dist/modules/cosmicintersection/index.js.map +1 -0
- package/dist/modules/ecoimpacthub/index.cjs +2042 -0
- package/dist/modules/ecoimpacthub/index.cjs.map +1 -0
- package/dist/modules/ecoimpacthub/index.d.cts +8 -0
- package/dist/modules/ecoimpacthub/index.d.ts +8 -0
- package/dist/modules/ecoimpacthub/index.js +1981 -0
- package/dist/modules/ecoimpacthub/index.js.map +1 -0
- package/dist/modules/govcitizenhub/index.cjs +1686 -0
- package/dist/modules/govcitizenhub/index.cjs.map +1 -0
- package/dist/modules/govcitizenhub/index.d.cts +8 -0
- package/dist/modules/govcitizenhub/index.d.ts +8 -0
- package/dist/modules/govcitizenhub/index.js +1625 -0
- package/dist/modules/govcitizenhub/index.js.map +1 -0
- package/dist/modules/intelwatchtower/index.cjs +1919 -0
- package/dist/modules/intelwatchtower/index.cjs.map +1 -0
- package/dist/modules/intelwatchtower/index.d.cts +8 -0
- package/dist/modules/intelwatchtower/index.d.ts +8 -0
- package/dist/modules/intelwatchtower/index.js +1858 -0
- package/dist/modules/intelwatchtower/index.js.map +1 -0
- package/dist/modules/manufacturedops/index.cjs +1884 -0
- package/dist/modules/manufacturedops/index.cjs.map +1 -0
- package/dist/modules/manufacturedops/index.d.cts +8 -0
- package/dist/modules/manufacturedops/index.d.ts +8 -0
- package/dist/modules/manufacturedops/index.js +1823 -0
- package/dist/modules/manufacturedops/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1625 @@
|
|
|
1
|
+
import { mcpToolName, errorResult, jsonResult, mcpResourceUri, mcpPromptName } from '../../chunk-H2OYWLOA.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
// src/modules/govcitizenhub/operations.ts
|
|
5
|
+
var AGENCY_FIELDS = `
|
|
6
|
+
id code name description jurisdiction contactEmail contactPhone
|
|
7
|
+
isActive tags workspaceId createdAt updatedAt
|
|
8
|
+
`;
|
|
9
|
+
var SERVICE_FIELDS = `
|
|
10
|
+
id agencyId name slug category status summary eligibility
|
|
11
|
+
feeType feeAmount currency slaDays requiredDocuments formSchema
|
|
12
|
+
tags publishedAt workspaceId createdAt updatedAt
|
|
13
|
+
`;
|
|
14
|
+
var APPLICATION_FIELDS = `
|
|
15
|
+
id reference serviceId citizenId assignedToId status priority
|
|
16
|
+
formData tags submittedAt dueDate decidedAt decisionReason
|
|
17
|
+
workspaceId createdAt updatedAt
|
|
18
|
+
`;
|
|
19
|
+
var DOCUMENT_FIELDS = `
|
|
20
|
+
id applicationId name requirement status rejectionReason
|
|
21
|
+
file { id } workspaceId createdAt updatedAt
|
|
22
|
+
`;
|
|
23
|
+
var CASE_NOTE_FIELDS = `
|
|
24
|
+
id applicationId authorId body type workspaceId createdAt updatedAt
|
|
25
|
+
`;
|
|
26
|
+
var PERMIT_FIELDS = `
|
|
27
|
+
id title serviceId holderId applicationId status verificationCode
|
|
28
|
+
issuedAt expiresAt revokedAt revokeReason file { id }
|
|
29
|
+
workspaceId createdAt updatedAt
|
|
30
|
+
`;
|
|
31
|
+
var GRIEVANCE_FIELDS = `
|
|
32
|
+
id title description category status priority reporterId assignedToId
|
|
33
|
+
agencyId location latitude longitude photoFileIds resolution resolvedAt
|
|
34
|
+
tags workspaceId createdAt updatedAt
|
|
35
|
+
`;
|
|
36
|
+
var PAYMENT_FIELDS = `
|
|
37
|
+
id applicationId payerId amount currency status providerRef
|
|
38
|
+
receiptNumber lineItems paidAt refundedAt workspaceId createdAt updatedAt
|
|
39
|
+
`;
|
|
40
|
+
var PAGE_INFO_FIELDS = `cursor hasMore`;
|
|
41
|
+
var GET_AGENCY = `
|
|
42
|
+
query GovGetAgency($id: ID!) {
|
|
43
|
+
govAgency(id: $id) {
|
|
44
|
+
${AGENCY_FIELDS}
|
|
45
|
+
services { id name slug category status }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
var LIST_AGENCIES = `
|
|
50
|
+
query GovListAgencies($isActive: Boolean, $pagination: PaginationInput) {
|
|
51
|
+
govListAgencies(isActive: $isActive, pagination: $pagination) {
|
|
52
|
+
${AGENCY_FIELDS}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
var CREATE_AGENCY = `
|
|
57
|
+
mutation GovCreateAgency($input: GovCreateAgencyInput!) {
|
|
58
|
+
govCreateAgency(input: $input) {
|
|
59
|
+
${AGENCY_FIELDS}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
var UPDATE_AGENCY = `
|
|
64
|
+
mutation GovUpdateAgency($id: ID!, $input: GovUpdateAgencyInput!) {
|
|
65
|
+
govUpdateAgency(id: $id, input: $input) {
|
|
66
|
+
${AGENCY_FIELDS}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
var ARCHIVE_AGENCY = `
|
|
71
|
+
mutation GovArchiveAgency($id: ID!) {
|
|
72
|
+
govArchiveAgency(id: $id)
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
var GET_SERVICE = `
|
|
76
|
+
query GovGetService($id: ID!) {
|
|
77
|
+
govService(id: $id) {
|
|
78
|
+
${SERVICE_FIELDS}
|
|
79
|
+
agency { id name code }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
`;
|
|
83
|
+
var LIST_SERVICES = `
|
|
84
|
+
query GovListServices(
|
|
85
|
+
$agencyId: ID
|
|
86
|
+
$category: GovServiceCategory
|
|
87
|
+
$status: GovServiceStatus
|
|
88
|
+
$pagination: PaginationInput
|
|
89
|
+
) {
|
|
90
|
+
govListServices(
|
|
91
|
+
agencyId: $agencyId
|
|
92
|
+
category: $category
|
|
93
|
+
status: $status
|
|
94
|
+
pagination: $pagination
|
|
95
|
+
) {
|
|
96
|
+
items { ${SERVICE_FIELDS} }
|
|
97
|
+
pageInfo { ${PAGE_INFO_FIELDS} }
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
var CREATE_SERVICE = `
|
|
102
|
+
mutation GovCreateService($input: GovCreateServiceInput!) {
|
|
103
|
+
govCreateService(input: $input) {
|
|
104
|
+
${SERVICE_FIELDS}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
108
|
+
var UPDATE_SERVICE = `
|
|
109
|
+
mutation GovUpdateService($id: ID!, $input: GovUpdateServiceInput!) {
|
|
110
|
+
govUpdateService(id: $id, input: $input) {
|
|
111
|
+
${SERVICE_FIELDS}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
`;
|
|
115
|
+
var TRANSITION_SERVICE = `
|
|
116
|
+
mutation GovTransitionService($id: ID!, $status: GovServiceStatus!) {
|
|
117
|
+
govTransitionService(id: $id, status: $status) {
|
|
118
|
+
${SERVICE_FIELDS}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`;
|
|
122
|
+
var GET_APPLICATION = `
|
|
123
|
+
query GovGetApplication($id: ID!) {
|
|
124
|
+
govApplication(id: $id) {
|
|
125
|
+
${APPLICATION_FIELDS}
|
|
126
|
+
documents { ${DOCUMENT_FIELDS} }
|
|
127
|
+
notes { ${CASE_NOTE_FIELDS} }
|
|
128
|
+
permits { ${PERMIT_FIELDS} }
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
var LIST_APPLICATIONS = `
|
|
133
|
+
query GovListApplications(
|
|
134
|
+
$assignedToId: ID
|
|
135
|
+
$citizenId: ID
|
|
136
|
+
$serviceId: ID
|
|
137
|
+
$status: GovApplicationStatus
|
|
138
|
+
$pagination: PaginationInput
|
|
139
|
+
) {
|
|
140
|
+
govListApplications(
|
|
141
|
+
assignedToId: $assignedToId
|
|
142
|
+
citizenId: $citizenId
|
|
143
|
+
serviceId: $serviceId
|
|
144
|
+
status: $status
|
|
145
|
+
pagination: $pagination
|
|
146
|
+
) {
|
|
147
|
+
items { ${APPLICATION_FIELDS} }
|
|
148
|
+
pageInfo { ${PAGE_INFO_FIELDS} }
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`;
|
|
152
|
+
var CREATE_APPLICATION = `
|
|
153
|
+
mutation GovCreateApplication($input: GovCreateApplicationInput!) {
|
|
154
|
+
govCreateApplication(input: $input) {
|
|
155
|
+
${APPLICATION_FIELDS}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
`;
|
|
159
|
+
var UPDATE_APPLICATION = `
|
|
160
|
+
mutation GovUpdateApplication($id: ID!, $input: GovUpdateApplicationInput!) {
|
|
161
|
+
govUpdateApplication(id: $id, input: $input) {
|
|
162
|
+
${APPLICATION_FIELDS}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
`;
|
|
166
|
+
var SUBMIT_APPLICATION = `
|
|
167
|
+
mutation GovSubmitApplication($id: ID!) {
|
|
168
|
+
govSubmitApplication(id: $id) {
|
|
169
|
+
${APPLICATION_FIELDS}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
`;
|
|
173
|
+
var TRANSITION_APPLICATION = `
|
|
174
|
+
mutation GovTransitionApplication(
|
|
175
|
+
$id: ID!
|
|
176
|
+
$status: GovApplicationStatus!
|
|
177
|
+
$reason: String
|
|
178
|
+
) {
|
|
179
|
+
govTransitionApplication(id: $id, status: $status, reason: $reason) {
|
|
180
|
+
${APPLICATION_FIELDS}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
`;
|
|
184
|
+
var ADD_DOCUMENT = `
|
|
185
|
+
mutation GovAddDocument($input: GovAddDocumentInput!) {
|
|
186
|
+
govAddDocument(input: $input) {
|
|
187
|
+
${DOCUMENT_FIELDS}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
`;
|
|
191
|
+
var REVIEW_DOCUMENT = `
|
|
192
|
+
mutation GovReviewDocument(
|
|
193
|
+
$id: ID!
|
|
194
|
+
$status: GovDocumentStatus!
|
|
195
|
+
$rejectionReason: String
|
|
196
|
+
) {
|
|
197
|
+
govReviewDocument(id: $id, status: $status, rejectionReason: $rejectionReason) {
|
|
198
|
+
${DOCUMENT_FIELDS}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
`;
|
|
202
|
+
var ADD_CASE_NOTE = `
|
|
203
|
+
mutation GovAddCaseNote($input: GovAddCaseNoteInput!) {
|
|
204
|
+
govAddCaseNote(input: $input) {
|
|
205
|
+
${CASE_NOTE_FIELDS}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
`;
|
|
209
|
+
var LIST_PERMITS = `
|
|
210
|
+
query GovListPermits($holderId: ID, $serviceId: ID, $status: GovPermitStatus) {
|
|
211
|
+
govListPermits(holderId: $holderId, serviceId: $serviceId, status: $status) {
|
|
212
|
+
${PERMIT_FIELDS}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
`;
|
|
216
|
+
var VERIFY_PERMIT = `
|
|
217
|
+
query GovVerifyPermit($verificationCode: String!) {
|
|
218
|
+
govVerifyPermit(verificationCode: $verificationCode) {
|
|
219
|
+
${PERMIT_FIELDS}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
`;
|
|
223
|
+
var ISSUE_PERMIT = `
|
|
224
|
+
mutation GovIssuePermit($input: GovIssuePermitInput!) {
|
|
225
|
+
govIssuePermit(input: $input) {
|
|
226
|
+
${PERMIT_FIELDS}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
`;
|
|
230
|
+
var REVOKE_PERMIT = `
|
|
231
|
+
mutation GovRevokePermit($id: ID!, $reason: String) {
|
|
232
|
+
govRevokePermit(id: $id, reason: $reason) {
|
|
233
|
+
${PERMIT_FIELDS}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
`;
|
|
237
|
+
var GET_GRIEVANCE = `
|
|
238
|
+
query GovGetGrievance($id: ID!) {
|
|
239
|
+
govGrievance(id: $id) {
|
|
240
|
+
${GRIEVANCE_FIELDS}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
`;
|
|
244
|
+
var LIST_GRIEVANCES = `
|
|
245
|
+
query GovListGrievances(
|
|
246
|
+
$agencyId: ID
|
|
247
|
+
$reporterId: ID
|
|
248
|
+
$status: GovGrievanceStatus
|
|
249
|
+
$pagination: PaginationInput
|
|
250
|
+
) {
|
|
251
|
+
govListGrievances(
|
|
252
|
+
agencyId: $agencyId
|
|
253
|
+
reporterId: $reporterId
|
|
254
|
+
status: $status
|
|
255
|
+
pagination: $pagination
|
|
256
|
+
) {
|
|
257
|
+
items { ${GRIEVANCE_FIELDS} }
|
|
258
|
+
pageInfo { ${PAGE_INFO_FIELDS} }
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
`;
|
|
262
|
+
var REPORT_GRIEVANCE = `
|
|
263
|
+
mutation GovReportGrievance($input: GovReportGrievanceInput!) {
|
|
264
|
+
govReportGrievance(input: $input) {
|
|
265
|
+
${GRIEVANCE_FIELDS}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
`;
|
|
269
|
+
var UPDATE_GRIEVANCE = `
|
|
270
|
+
mutation GovUpdateGrievance($id: ID!, $input: GovUpdateGrievanceInput!) {
|
|
271
|
+
govUpdateGrievance(id: $id, input: $input) {
|
|
272
|
+
${GRIEVANCE_FIELDS}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
`;
|
|
276
|
+
var TRANSITION_GRIEVANCE = `
|
|
277
|
+
mutation GovTransitionGrievance(
|
|
278
|
+
$id: ID!
|
|
279
|
+
$status: GovGrievanceStatus!
|
|
280
|
+
$resolution: String
|
|
281
|
+
) {
|
|
282
|
+
govTransitionGrievance(id: $id, status: $status, resolution: $resolution) {
|
|
283
|
+
${GRIEVANCE_FIELDS}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
`;
|
|
287
|
+
var GET_PAYMENT = `
|
|
288
|
+
query GovGetPayment($id: ID!) {
|
|
289
|
+
govPayment(id: $id) {
|
|
290
|
+
${PAYMENT_FIELDS}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
`;
|
|
294
|
+
var LIST_PAYMENTS = `
|
|
295
|
+
query GovListPayments(
|
|
296
|
+
$applicationId: ID
|
|
297
|
+
$payerId: ID
|
|
298
|
+
$status: GovPaymentStatus
|
|
299
|
+
$pagination: PaginationInput
|
|
300
|
+
) {
|
|
301
|
+
govListPayments(
|
|
302
|
+
applicationId: $applicationId
|
|
303
|
+
payerId: $payerId
|
|
304
|
+
status: $status
|
|
305
|
+
pagination: $pagination
|
|
306
|
+
) {
|
|
307
|
+
items { ${PAYMENT_FIELDS} }
|
|
308
|
+
pageInfo { ${PAGE_INFO_FIELDS} }
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
`;
|
|
312
|
+
var CREATE_PAYMENT = `
|
|
313
|
+
mutation GovCreatePayment($input: GovCreatePaymentInput!) {
|
|
314
|
+
govCreatePayment(input: $input) {
|
|
315
|
+
${PAYMENT_FIELDS}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
`;
|
|
319
|
+
var MARK_PAYMENT_PAID = `
|
|
320
|
+
mutation GovMarkPaymentPaid($id: ID!, $providerRef: String) {
|
|
321
|
+
govMarkPaymentPaid(id: $id, providerRef: $providerRef) {
|
|
322
|
+
${PAYMENT_FIELDS}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
`;
|
|
326
|
+
var REFUND_PAYMENT = `
|
|
327
|
+
mutation GovRefundPayment($id: ID!) {
|
|
328
|
+
govRefundPayment(id: $id) {
|
|
329
|
+
${PAYMENT_FIELDS}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
`;
|
|
333
|
+
var HEALTH = `
|
|
334
|
+
query GovHealth {
|
|
335
|
+
govHealth
|
|
336
|
+
}
|
|
337
|
+
`;
|
|
338
|
+
var ServiceCategoryEnum = z.enum([
|
|
339
|
+
"CERTIFICATES",
|
|
340
|
+
"EDUCATION",
|
|
341
|
+
"GRIEVANCES",
|
|
342
|
+
"HEALTH",
|
|
343
|
+
"LICENCES_AND_PERMITS",
|
|
344
|
+
"OTHER",
|
|
345
|
+
"SOCIAL_WELFARE",
|
|
346
|
+
"TAXES_AND_PAYMENTS",
|
|
347
|
+
"UTILITIES"
|
|
348
|
+
]).describe("Top-level category of a public service or grievance");
|
|
349
|
+
var ServiceStatusEnum = z.enum(["DRAFT", "PUBLISHED", "RETIRED", "SUSPENDED"]).describe("Publication lifecycle status of a service");
|
|
350
|
+
var FeeTypeEnum = z.enum(["FIXED", "FREE", "VARIABLE"]).describe("How a service is charged: FREE, a FIXED amount, or VARIABLE");
|
|
351
|
+
var ApplicationStatusEnum = z.enum(["APPROVED", "DRAFT", "INFO_REQUESTED", "IN_REVIEW", "REJECTED", "SUBMITTED", "WITHDRAWN"]).describe("Review-lifecycle status of a citizen application");
|
|
352
|
+
var CasePriorityEnum = z.enum(["HIGH", "LOW", "NORMAL", "URGENT"]).describe("Priority of an application or grievance");
|
|
353
|
+
var CaseNoteTypeEnum = z.enum(["CITIZEN_MESSAGE", "DECISION", "INFO_REQUEST", "INTERNAL"]).describe("Kind of case note on an application");
|
|
354
|
+
var DocumentStatusEnum = z.enum(["ACCEPTED", "PENDING", "REJECTED"]).describe("Review status of a submitted document");
|
|
355
|
+
var GrievanceStatusEnum = z.enum(["ACKNOWLEDGED", "CLOSED", "IN_PROGRESS", "OPEN", "REJECTED", "RESOLVED"]).describe("Resolution-lifecycle status of a grievance");
|
|
356
|
+
var PaymentStatusEnum = z.enum(["FAILED", "PAID", "PENDING", "REFUNDED"]).describe("Status of a fee payment");
|
|
357
|
+
var PermitStatusEnum = z.enum(["ACTIVE", "EXPIRED", "ISSUED", "REVOKED"]).describe("Lifecycle status of an issued permit");
|
|
358
|
+
var JsonObject = z.record(z.string(), z.unknown());
|
|
359
|
+
function buildPagination(args) {
|
|
360
|
+
const pagination = {};
|
|
361
|
+
if (args.limit !== void 0) pagination.limit = args.limit;
|
|
362
|
+
if (args.offset !== void 0) pagination.offset = args.offset;
|
|
363
|
+
if (args.cursor !== void 0) pagination.cursor = args.cursor;
|
|
364
|
+
return Object.keys(pagination).length > 0 ? pagination : void 0;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// src/modules/govcitizenhub/tools/agencies.ts
|
|
368
|
+
function registerAgencyTools(server, ctx, track) {
|
|
369
|
+
server.registerTool(
|
|
370
|
+
track(mcpToolName(ctx.productName, "agencies_get")),
|
|
371
|
+
{
|
|
372
|
+
title: "Get Agency",
|
|
373
|
+
description: "Fetch a single GovCitizenHub government agency by ID, including the services it operates.",
|
|
374
|
+
inputSchema: { id: z.string().describe("Agency ID") }
|
|
375
|
+
},
|
|
376
|
+
async ({ id }) => {
|
|
377
|
+
try {
|
|
378
|
+
const data = await ctx.gql.workspace.request(GET_AGENCY, { id });
|
|
379
|
+
if (!data.govAgency) return errorResult(`Agency ${id} not found`);
|
|
380
|
+
return jsonResult(data.govAgency);
|
|
381
|
+
} catch (error) {
|
|
382
|
+
ctx.logger.error("govcitizenhub agencies_get failed", { error: String(error) });
|
|
383
|
+
return errorResult(
|
|
384
|
+
`Failed to get agency: ${error instanceof Error ? error.message : String(error)}`
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
);
|
|
389
|
+
server.registerTool(
|
|
390
|
+
track(mcpToolName(ctx.productName, "agencies_list")),
|
|
391
|
+
{
|
|
392
|
+
title: "List Agencies",
|
|
393
|
+
description: "List government agencies in the bound workspace with an optional active filter and pagination.",
|
|
394
|
+
inputSchema: {
|
|
395
|
+
isActive: z.boolean().optional().describe("Only active (true) or archived (false) agencies"),
|
|
396
|
+
limit: z.number().int().optional().describe("Page size (default 50)"),
|
|
397
|
+
offset: z.number().int().optional().describe("Pagination offset (default 0)"),
|
|
398
|
+
cursor: z.string().optional().describe("Opaque pagination cursor")
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
async ({ isActive, limit, offset, cursor }) => {
|
|
402
|
+
try {
|
|
403
|
+
const data = await ctx.gql.workspace.request(LIST_AGENCIES, {
|
|
404
|
+
isActive,
|
|
405
|
+
pagination: buildPagination({ limit, offset, cursor })
|
|
406
|
+
});
|
|
407
|
+
return jsonResult(data.govListAgencies);
|
|
408
|
+
} catch (error) {
|
|
409
|
+
ctx.logger.error("govcitizenhub agencies_list failed", { error: String(error) });
|
|
410
|
+
return errorResult(
|
|
411
|
+
`Failed to list agencies: ${error instanceof Error ? error.message : String(error)}`
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
server.registerTool(
|
|
417
|
+
track(mcpToolName(ctx.productName, "agencies_create")),
|
|
418
|
+
{
|
|
419
|
+
title: "Create Agency",
|
|
420
|
+
description: "Register a new government agency in the bound workspace.",
|
|
421
|
+
inputSchema: {
|
|
422
|
+
name: z.string().min(1).describe("Agency display name"),
|
|
423
|
+
code: z.string().optional().describe("Short agency code"),
|
|
424
|
+
description: z.string().optional().describe("Agency description"),
|
|
425
|
+
jurisdiction: z.string().optional().describe("Geographic/legal jurisdiction"),
|
|
426
|
+
contactEmail: z.string().optional().describe("Public contact email"),
|
|
427
|
+
contactPhone: z.string().optional().describe("Public contact phone"),
|
|
428
|
+
tags: z.array(z.string()).optional().describe("Free-form tags")
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
async ({ name, code, description, jurisdiction, contactEmail, contactPhone, tags }) => {
|
|
432
|
+
try {
|
|
433
|
+
const input = { name };
|
|
434
|
+
if (code !== void 0) input.code = code;
|
|
435
|
+
if (description !== void 0) input.description = description;
|
|
436
|
+
if (jurisdiction !== void 0) input.jurisdiction = jurisdiction;
|
|
437
|
+
if (contactEmail !== void 0) input.contactEmail = contactEmail;
|
|
438
|
+
if (contactPhone !== void 0) input.contactPhone = contactPhone;
|
|
439
|
+
if (tags !== void 0) input.tags = tags;
|
|
440
|
+
const data = await ctx.gql.workspace.request(CREATE_AGENCY, { input });
|
|
441
|
+
return jsonResult(data.govCreateAgency);
|
|
442
|
+
} catch (error) {
|
|
443
|
+
ctx.logger.error("govcitizenhub agencies_create failed", { error: String(error) });
|
|
444
|
+
return errorResult(
|
|
445
|
+
`Failed to create agency: ${error instanceof Error ? error.message : String(error)}`
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
);
|
|
450
|
+
server.registerTool(
|
|
451
|
+
track(mcpToolName(ctx.productName, "agencies_update")),
|
|
452
|
+
{
|
|
453
|
+
title: "Update Agency",
|
|
454
|
+
description: "Update a government agency. At least one mutable field must be provided. Use `isActive` to (de)activate.",
|
|
455
|
+
inputSchema: {
|
|
456
|
+
id: z.string().describe("Agency ID"),
|
|
457
|
+
name: z.string().optional().describe("Updated display name"),
|
|
458
|
+
code: z.string().optional().describe("Updated agency code"),
|
|
459
|
+
description: z.string().optional().describe("Updated description"),
|
|
460
|
+
jurisdiction: z.string().optional().describe("Updated jurisdiction"),
|
|
461
|
+
contactEmail: z.string().optional().describe("Updated contact email"),
|
|
462
|
+
contactPhone: z.string().optional().describe("Updated contact phone"),
|
|
463
|
+
isActive: z.boolean().optional().describe("Updated active flag"),
|
|
464
|
+
tags: z.array(z.string()).optional().describe("Updated tags")
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
async ({
|
|
468
|
+
id,
|
|
469
|
+
name,
|
|
470
|
+
code,
|
|
471
|
+
description,
|
|
472
|
+
jurisdiction,
|
|
473
|
+
contactEmail,
|
|
474
|
+
contactPhone,
|
|
475
|
+
isActive,
|
|
476
|
+
tags
|
|
477
|
+
}) => {
|
|
478
|
+
try {
|
|
479
|
+
const input = {};
|
|
480
|
+
if (name !== void 0) input.name = name;
|
|
481
|
+
if (code !== void 0) input.code = code;
|
|
482
|
+
if (description !== void 0) input.description = description;
|
|
483
|
+
if (jurisdiction !== void 0) input.jurisdiction = jurisdiction;
|
|
484
|
+
if (contactEmail !== void 0) input.contactEmail = contactEmail;
|
|
485
|
+
if (contactPhone !== void 0) input.contactPhone = contactPhone;
|
|
486
|
+
if (isActive !== void 0) input.isActive = isActive;
|
|
487
|
+
if (tags !== void 0) input.tags = tags;
|
|
488
|
+
if (Object.keys(input).length === 0) {
|
|
489
|
+
return errorResult(
|
|
490
|
+
"No updates specified \u2014 provide at least one of name/code/description/jurisdiction/contactEmail/contactPhone/isActive/tags"
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
const data = await ctx.gql.workspace.request(UPDATE_AGENCY, { id, input });
|
|
494
|
+
return jsonResult(data.govUpdateAgency);
|
|
495
|
+
} catch (error) {
|
|
496
|
+
ctx.logger.error("govcitizenhub agencies_update failed", { error: String(error) });
|
|
497
|
+
return errorResult(
|
|
498
|
+
`Failed to update agency: ${error instanceof Error ? error.message : String(error)}`
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
);
|
|
503
|
+
server.registerTool(
|
|
504
|
+
track(mcpToolName(ctx.productName, "agencies_archive")),
|
|
505
|
+
{
|
|
506
|
+
title: "Archive Agency",
|
|
507
|
+
description: "Archive (soft-delete) a government agency. Returns true on success.",
|
|
508
|
+
inputSchema: { id: z.string().describe("Agency ID") }
|
|
509
|
+
},
|
|
510
|
+
async ({ id }) => {
|
|
511
|
+
try {
|
|
512
|
+
const data = await ctx.gql.workspace.request(
|
|
513
|
+
ARCHIVE_AGENCY,
|
|
514
|
+
{ id }
|
|
515
|
+
);
|
|
516
|
+
return jsonResult({ archived: data.govArchiveAgency });
|
|
517
|
+
} catch (error) {
|
|
518
|
+
ctx.logger.error("govcitizenhub agencies_archive failed", { error: String(error) });
|
|
519
|
+
return errorResult(
|
|
520
|
+
`Failed to archive agency: ${error instanceof Error ? error.message : String(error)}`
|
|
521
|
+
);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
function registerServiceTools(server, ctx, track) {
|
|
527
|
+
server.registerTool(
|
|
528
|
+
track(mcpToolName(ctx.productName, "services_get")),
|
|
529
|
+
{
|
|
530
|
+
title: "Get Service",
|
|
531
|
+
description: "Fetch a single GovCitizenHub public service by ID, including its owning agency.",
|
|
532
|
+
inputSchema: { id: z.string().describe("Service ID") }
|
|
533
|
+
},
|
|
534
|
+
async ({ id }) => {
|
|
535
|
+
try {
|
|
536
|
+
const data = await ctx.gql.workspace.request(GET_SERVICE, { id });
|
|
537
|
+
if (!data.govService) return errorResult(`Service ${id} not found`);
|
|
538
|
+
return jsonResult(data.govService);
|
|
539
|
+
} catch (error) {
|
|
540
|
+
ctx.logger.error("govcitizenhub services_get failed", { error: String(error) });
|
|
541
|
+
return errorResult(
|
|
542
|
+
`Failed to get service: ${error instanceof Error ? error.message : String(error)}`
|
|
543
|
+
);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
);
|
|
547
|
+
server.registerTool(
|
|
548
|
+
track(mcpToolName(ctx.productName, "services_list")),
|
|
549
|
+
{
|
|
550
|
+
title: "List Services",
|
|
551
|
+
description: "List public services in the bound workspace with optional agency/category/status filters and pagination. Returns a connection ({ items, pageInfo }).",
|
|
552
|
+
inputSchema: {
|
|
553
|
+
agencyId: z.string().optional().describe("Filter by owning agency ID"),
|
|
554
|
+
category: ServiceCategoryEnum.optional().describe("Filter by category"),
|
|
555
|
+
status: ServiceStatusEnum.optional().describe("Filter by publication status"),
|
|
556
|
+
limit: z.number().int().optional().describe("Page size (default 50)"),
|
|
557
|
+
offset: z.number().int().optional().describe("Pagination offset (default 0)"),
|
|
558
|
+
cursor: z.string().optional().describe("Opaque pagination cursor")
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
async ({ agencyId, category, status, limit, offset, cursor }) => {
|
|
562
|
+
try {
|
|
563
|
+
const data = await ctx.gql.workspace.request(LIST_SERVICES, {
|
|
564
|
+
agencyId,
|
|
565
|
+
category,
|
|
566
|
+
status,
|
|
567
|
+
pagination: buildPagination({ limit, offset, cursor })
|
|
568
|
+
});
|
|
569
|
+
return jsonResult(data.govListServices);
|
|
570
|
+
} catch (error) {
|
|
571
|
+
ctx.logger.error("govcitizenhub services_list failed", { error: String(error) });
|
|
572
|
+
return errorResult(
|
|
573
|
+
`Failed to list services: ${error instanceof Error ? error.message : String(error)}`
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
);
|
|
578
|
+
server.registerTool(
|
|
579
|
+
track(mcpToolName(ctx.productName, "services_create")),
|
|
580
|
+
{
|
|
581
|
+
title: "Create Service",
|
|
582
|
+
description: "Create a public service under an agency. `slug` must be unique within the workspace; `feeType`+`feeAmount` define the fee model.",
|
|
583
|
+
inputSchema: {
|
|
584
|
+
agencyId: z.string().min(1).describe("Owning agency ID"),
|
|
585
|
+
name: z.string().min(1).describe("Service display name"),
|
|
586
|
+
slug: z.string().min(1).describe("URL slug, unique within the workspace"),
|
|
587
|
+
category: ServiceCategoryEnum.optional().describe("Service category (default OTHER)"),
|
|
588
|
+
summary: z.string().optional().describe("Short summary"),
|
|
589
|
+
eligibility: z.string().optional().describe("Eligibility criteria text"),
|
|
590
|
+
feeType: FeeTypeEnum.optional().describe("Fee model (default FREE)"),
|
|
591
|
+
feeAmount: z.number().optional().describe("Fee amount (for FIXED/VARIABLE)"),
|
|
592
|
+
currency: z.string().optional().describe("ISO currency code for the fee"),
|
|
593
|
+
slaDays: z.number().int().optional().describe("Target turnaround in days"),
|
|
594
|
+
requiredDocuments: z.array(z.string()).optional().describe("Names of documents the citizen must submit"),
|
|
595
|
+
formSchema: JsonObject.optional().describe("JSON schema describing the application form"),
|
|
596
|
+
tags: z.array(z.string()).optional().describe("Free-form tags")
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
async ({
|
|
600
|
+
agencyId,
|
|
601
|
+
name,
|
|
602
|
+
slug,
|
|
603
|
+
category,
|
|
604
|
+
summary,
|
|
605
|
+
eligibility,
|
|
606
|
+
feeType,
|
|
607
|
+
feeAmount,
|
|
608
|
+
currency,
|
|
609
|
+
slaDays,
|
|
610
|
+
requiredDocuments,
|
|
611
|
+
formSchema,
|
|
612
|
+
tags
|
|
613
|
+
}) => {
|
|
614
|
+
try {
|
|
615
|
+
const input = { agencyId, name, slug };
|
|
616
|
+
if (category !== void 0) input.category = category;
|
|
617
|
+
if (summary !== void 0) input.summary = summary;
|
|
618
|
+
if (eligibility !== void 0) input.eligibility = eligibility;
|
|
619
|
+
if (feeType !== void 0) input.feeType = feeType;
|
|
620
|
+
if (feeAmount !== void 0) input.feeAmount = feeAmount;
|
|
621
|
+
if (currency !== void 0) input.currency = currency;
|
|
622
|
+
if (slaDays !== void 0) input.slaDays = slaDays;
|
|
623
|
+
if (requiredDocuments !== void 0) input.requiredDocuments = requiredDocuments;
|
|
624
|
+
if (formSchema !== void 0) input.formSchema = formSchema;
|
|
625
|
+
if (tags !== void 0) input.tags = tags;
|
|
626
|
+
const data = await ctx.gql.workspace.request(CREATE_SERVICE, { input });
|
|
627
|
+
return jsonResult(data.govCreateService);
|
|
628
|
+
} catch (error) {
|
|
629
|
+
ctx.logger.error("govcitizenhub services_create failed", { error: String(error) });
|
|
630
|
+
return errorResult(
|
|
631
|
+
`Failed to create service: ${error instanceof Error ? error.message : String(error)}`
|
|
632
|
+
);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
);
|
|
636
|
+
server.registerTool(
|
|
637
|
+
track(mcpToolName(ctx.productName, "services_update")),
|
|
638
|
+
{
|
|
639
|
+
title: "Update Service",
|
|
640
|
+
description: "Update a public service. At least one mutable field must be provided.",
|
|
641
|
+
inputSchema: {
|
|
642
|
+
id: z.string().describe("Service ID"),
|
|
643
|
+
name: z.string().optional().describe("Updated display name"),
|
|
644
|
+
category: ServiceCategoryEnum.optional().describe("Updated category"),
|
|
645
|
+
summary: z.string().optional().describe("Updated summary"),
|
|
646
|
+
eligibility: z.string().optional().describe("Updated eligibility text"),
|
|
647
|
+
feeType: FeeTypeEnum.optional().describe("Updated fee model"),
|
|
648
|
+
feeAmount: z.number().optional().describe("Updated fee amount"),
|
|
649
|
+
currency: z.string().optional().describe("Updated currency"),
|
|
650
|
+
slaDays: z.number().int().optional().describe("Updated SLA days"),
|
|
651
|
+
requiredDocuments: z.array(z.string()).optional().describe("Updated required documents"),
|
|
652
|
+
formSchema: JsonObject.optional().describe("Updated form schema JSON"),
|
|
653
|
+
tags: z.array(z.string()).optional().describe("Updated tags")
|
|
654
|
+
}
|
|
655
|
+
},
|
|
656
|
+
async ({
|
|
657
|
+
id,
|
|
658
|
+
name,
|
|
659
|
+
category,
|
|
660
|
+
summary,
|
|
661
|
+
eligibility,
|
|
662
|
+
feeType,
|
|
663
|
+
feeAmount,
|
|
664
|
+
currency,
|
|
665
|
+
slaDays,
|
|
666
|
+
requiredDocuments,
|
|
667
|
+
formSchema,
|
|
668
|
+
tags
|
|
669
|
+
}) => {
|
|
670
|
+
try {
|
|
671
|
+
const input = {};
|
|
672
|
+
if (name !== void 0) input.name = name;
|
|
673
|
+
if (category !== void 0) input.category = category;
|
|
674
|
+
if (summary !== void 0) input.summary = summary;
|
|
675
|
+
if (eligibility !== void 0) input.eligibility = eligibility;
|
|
676
|
+
if (feeType !== void 0) input.feeType = feeType;
|
|
677
|
+
if (feeAmount !== void 0) input.feeAmount = feeAmount;
|
|
678
|
+
if (currency !== void 0) input.currency = currency;
|
|
679
|
+
if (slaDays !== void 0) input.slaDays = slaDays;
|
|
680
|
+
if (requiredDocuments !== void 0) input.requiredDocuments = requiredDocuments;
|
|
681
|
+
if (formSchema !== void 0) input.formSchema = formSchema;
|
|
682
|
+
if (tags !== void 0) input.tags = tags;
|
|
683
|
+
if (Object.keys(input).length === 0) {
|
|
684
|
+
return errorResult(
|
|
685
|
+
"No updates specified \u2014 provide at least one of name/category/summary/eligibility/feeType/feeAmount/currency/slaDays/requiredDocuments/formSchema/tags"
|
|
686
|
+
);
|
|
687
|
+
}
|
|
688
|
+
const data = await ctx.gql.workspace.request(UPDATE_SERVICE, { id, input });
|
|
689
|
+
return jsonResult(data.govUpdateService);
|
|
690
|
+
} catch (error) {
|
|
691
|
+
ctx.logger.error("govcitizenhub services_update failed", { error: String(error) });
|
|
692
|
+
return errorResult(
|
|
693
|
+
`Failed to update service: ${error instanceof Error ? error.message : String(error)}`
|
|
694
|
+
);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
);
|
|
698
|
+
server.registerTool(
|
|
699
|
+
track(mcpToolName(ctx.productName, "services_transition")),
|
|
700
|
+
{
|
|
701
|
+
title: "Transition Service",
|
|
702
|
+
description: "Advance a service through its publication lifecycle (DRAFT \u2192 PUBLISHED \u2192 SUSPENDED/RETIRED) with validated transitions.",
|
|
703
|
+
inputSchema: {
|
|
704
|
+
id: z.string().describe("Service ID"),
|
|
705
|
+
status: ServiceStatusEnum.describe("Target publication status")
|
|
706
|
+
}
|
|
707
|
+
},
|
|
708
|
+
async ({ id, status }) => {
|
|
709
|
+
try {
|
|
710
|
+
const data = await ctx.gql.workspace.request(TRANSITION_SERVICE, { id, status });
|
|
711
|
+
return jsonResult(data.govTransitionService);
|
|
712
|
+
} catch (error) {
|
|
713
|
+
ctx.logger.error("govcitizenhub services_transition failed", { error: String(error) });
|
|
714
|
+
return errorResult(
|
|
715
|
+
`Failed to transition service: ${error instanceof Error ? error.message : String(error)}`
|
|
716
|
+
);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
);
|
|
720
|
+
}
|
|
721
|
+
function registerApplicationTools(server, ctx, track) {
|
|
722
|
+
server.registerTool(
|
|
723
|
+
track(mcpToolName(ctx.productName, "applications_get")),
|
|
724
|
+
{
|
|
725
|
+
title: "Get Application",
|
|
726
|
+
description: "Fetch a single GovCitizenHub citizen application by ID, including its documents, case notes, and issued permits.",
|
|
727
|
+
inputSchema: { id: z.string().describe("Application ID") }
|
|
728
|
+
},
|
|
729
|
+
async ({ id }) => {
|
|
730
|
+
try {
|
|
731
|
+
const data = await ctx.gql.workspace.request(GET_APPLICATION, { id });
|
|
732
|
+
if (!data.govApplication) return errorResult(`Application ${id} not found`);
|
|
733
|
+
return jsonResult(data.govApplication);
|
|
734
|
+
} catch (error) {
|
|
735
|
+
ctx.logger.error("govcitizenhub applications_get failed", { error: String(error) });
|
|
736
|
+
return errorResult(
|
|
737
|
+
`Failed to get application: ${error instanceof Error ? error.message : String(error)}`
|
|
738
|
+
);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
);
|
|
742
|
+
server.registerTool(
|
|
743
|
+
track(mcpToolName(ctx.productName, "applications_list")),
|
|
744
|
+
{
|
|
745
|
+
title: "List Applications",
|
|
746
|
+
description: "List citizen applications with optional citizen/service/assignee/status filters and pagination. Returns a connection ({ items, pageInfo }).",
|
|
747
|
+
inputSchema: {
|
|
748
|
+
citizenId: z.string().optional().describe("Filter by applicant (citizen) user ID"),
|
|
749
|
+
serviceId: z.string().optional().describe("Filter by service ID"),
|
|
750
|
+
assignedToId: z.string().optional().describe("Filter by assigned caseworker user ID"),
|
|
751
|
+
status: ApplicationStatusEnum.optional().describe("Filter by review status"),
|
|
752
|
+
limit: z.number().int().optional().describe("Page size (default 50)"),
|
|
753
|
+
offset: z.number().int().optional().describe("Pagination offset (default 0)"),
|
|
754
|
+
cursor: z.string().optional().describe("Opaque pagination cursor")
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
async ({ citizenId, serviceId, assignedToId, status, limit, offset, cursor }) => {
|
|
758
|
+
try {
|
|
759
|
+
const data = await ctx.gql.workspace.request(LIST_APPLICATIONS, {
|
|
760
|
+
citizenId,
|
|
761
|
+
serviceId,
|
|
762
|
+
assignedToId,
|
|
763
|
+
status,
|
|
764
|
+
pagination: buildPagination({ limit, offset, cursor })
|
|
765
|
+
});
|
|
766
|
+
return jsonResult(data.govListApplications);
|
|
767
|
+
} catch (error) {
|
|
768
|
+
ctx.logger.error("govcitizenhub applications_list failed", { error: String(error) });
|
|
769
|
+
return errorResult(
|
|
770
|
+
`Failed to list applications: ${error instanceof Error ? error.message : String(error)}`
|
|
771
|
+
);
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
);
|
|
775
|
+
server.registerTool(
|
|
776
|
+
track(mcpToolName(ctx.productName, "applications_create")),
|
|
777
|
+
{
|
|
778
|
+
title: "Create Application",
|
|
779
|
+
description: "Start a new citizen application against a service (created in DRAFT). The applicant identity comes from the gateway actor headers.",
|
|
780
|
+
inputSchema: {
|
|
781
|
+
serviceId: z.string().min(1).describe("Service being applied for"),
|
|
782
|
+
reference: z.string().optional().describe("Optional caller-supplied reference number"),
|
|
783
|
+
priority: CasePriorityEnum.optional().describe("Priority (default NORMAL)"),
|
|
784
|
+
formData: JsonObject.optional().describe("Submitted form data JSON"),
|
|
785
|
+
tags: z.array(z.string()).optional().describe("Free-form tags")
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
async ({ serviceId, reference, priority, formData, tags }) => {
|
|
789
|
+
try {
|
|
790
|
+
const input = { serviceId };
|
|
791
|
+
if (reference !== void 0) input.reference = reference;
|
|
792
|
+
if (priority !== void 0) input.priority = priority;
|
|
793
|
+
if (formData !== void 0) input.formData = formData;
|
|
794
|
+
if (tags !== void 0) input.tags = tags;
|
|
795
|
+
const data = await ctx.gql.workspace.request(CREATE_APPLICATION, { input });
|
|
796
|
+
return jsonResult(data.govCreateApplication);
|
|
797
|
+
} catch (error) {
|
|
798
|
+
ctx.logger.error("govcitizenhub applications_create failed", { error: String(error) });
|
|
799
|
+
return errorResult(
|
|
800
|
+
`Failed to create application: ${error instanceof Error ? error.message : String(error)}`
|
|
801
|
+
);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
);
|
|
805
|
+
server.registerTool(
|
|
806
|
+
track(mcpToolName(ctx.productName, "applications_update")),
|
|
807
|
+
{
|
|
808
|
+
title: "Update Application",
|
|
809
|
+
description: "Update a draft/in-progress application. At least one mutable field must be provided. Use `assignedToId` to assign a caseworker.",
|
|
810
|
+
inputSchema: {
|
|
811
|
+
id: z.string().describe("Application ID"),
|
|
812
|
+
assignedToId: z.string().optional().describe("Assigned caseworker user ID"),
|
|
813
|
+
priority: CasePriorityEnum.optional().describe("Updated priority"),
|
|
814
|
+
formData: JsonObject.optional().describe("Updated form data JSON"),
|
|
815
|
+
tags: z.array(z.string()).optional().describe("Updated tags")
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
async ({ id, assignedToId, priority, formData, tags }) => {
|
|
819
|
+
try {
|
|
820
|
+
const input = {};
|
|
821
|
+
if (assignedToId !== void 0) input.assignedToId = assignedToId;
|
|
822
|
+
if (priority !== void 0) input.priority = priority;
|
|
823
|
+
if (formData !== void 0) input.formData = formData;
|
|
824
|
+
if (tags !== void 0) input.tags = tags;
|
|
825
|
+
if (Object.keys(input).length === 0) {
|
|
826
|
+
return errorResult(
|
|
827
|
+
"No updates specified \u2014 provide at least one of assignedToId/priority/formData/tags"
|
|
828
|
+
);
|
|
829
|
+
}
|
|
830
|
+
const data = await ctx.gql.workspace.request(UPDATE_APPLICATION, { id, input });
|
|
831
|
+
return jsonResult(data.govUpdateApplication);
|
|
832
|
+
} catch (error) {
|
|
833
|
+
ctx.logger.error("govcitizenhub applications_update failed", { error: String(error) });
|
|
834
|
+
return errorResult(
|
|
835
|
+
`Failed to update application: ${error instanceof Error ? error.message : String(error)}`
|
|
836
|
+
);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
);
|
|
840
|
+
server.registerTool(
|
|
841
|
+
track(mcpToolName(ctx.productName, "applications_submit")),
|
|
842
|
+
{
|
|
843
|
+
title: "Submit Application",
|
|
844
|
+
description: "Submit a DRAFT application for review (moves it to SUBMITTED).",
|
|
845
|
+
inputSchema: { id: z.string().describe("Application ID") }
|
|
846
|
+
},
|
|
847
|
+
async ({ id }) => {
|
|
848
|
+
try {
|
|
849
|
+
const data = await ctx.gql.workspace.request(SUBMIT_APPLICATION, { id });
|
|
850
|
+
return jsonResult(data.govSubmitApplication);
|
|
851
|
+
} catch (error) {
|
|
852
|
+
ctx.logger.error("govcitizenhub applications_submit failed", { error: String(error) });
|
|
853
|
+
return errorResult(
|
|
854
|
+
`Failed to submit application: ${error instanceof Error ? error.message : String(error)}`
|
|
855
|
+
);
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
);
|
|
859
|
+
server.registerTool(
|
|
860
|
+
track(mcpToolName(ctx.productName, "applications_transition")),
|
|
861
|
+
{
|
|
862
|
+
title: "Transition Application",
|
|
863
|
+
description: "Advance an application through its review lifecycle (SUBMITTED \u2192 IN_REVIEW \u2192 INFO_REQUESTED/APPROVED/REJECTED/WITHDRAWN) with validated transitions. `reason` is recorded with the decision.",
|
|
864
|
+
inputSchema: {
|
|
865
|
+
id: z.string().describe("Application ID"),
|
|
866
|
+
status: ApplicationStatusEnum.describe("Target review status"),
|
|
867
|
+
reason: z.string().optional().describe("Reason/decision note for the transition")
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
async ({ id, status, reason }) => {
|
|
871
|
+
try {
|
|
872
|
+
const data = await ctx.gql.workspace.request(TRANSITION_APPLICATION, { id, status, reason });
|
|
873
|
+
return jsonResult(data.govTransitionApplication);
|
|
874
|
+
} catch (error) {
|
|
875
|
+
ctx.logger.error("govcitizenhub applications_transition failed", { error: String(error) });
|
|
876
|
+
return errorResult(
|
|
877
|
+
`Failed to transition application: ${error instanceof Error ? error.message : String(error)}`
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
);
|
|
882
|
+
}
|
|
883
|
+
function registerDocumentTools(server, ctx, track) {
|
|
884
|
+
server.registerTool(
|
|
885
|
+
track(mcpToolName(ctx.productName, "documents_add")),
|
|
886
|
+
{
|
|
887
|
+
title: "Add Document",
|
|
888
|
+
description: "Attach a supporting document to an application. `fileId` references an already-uploaded wspace-files-svc File; `requirement` ties it to a service-required document.",
|
|
889
|
+
inputSchema: {
|
|
890
|
+
applicationId: z.string().min(1).describe("Application the document belongs to"),
|
|
891
|
+
name: z.string().min(1).describe("Document display name"),
|
|
892
|
+
fileId: z.string().optional().describe("wspace-files-svc File ID for the uploaded blob"),
|
|
893
|
+
requirement: z.string().optional().describe("Name of the required-document slot this satisfies")
|
|
894
|
+
}
|
|
895
|
+
},
|
|
896
|
+
async ({ applicationId, name, fileId, requirement }) => {
|
|
897
|
+
try {
|
|
898
|
+
const input = { applicationId, name };
|
|
899
|
+
if (fileId !== void 0) input.fileId = fileId;
|
|
900
|
+
if (requirement !== void 0) input.requirement = requirement;
|
|
901
|
+
const data = await ctx.gql.workspace.request(ADD_DOCUMENT, { input });
|
|
902
|
+
return jsonResult(data.govAddDocument);
|
|
903
|
+
} catch (error) {
|
|
904
|
+
ctx.logger.error("govcitizenhub documents_add failed", { error: String(error) });
|
|
905
|
+
return errorResult(
|
|
906
|
+
`Failed to add document: ${error instanceof Error ? error.message : String(error)}`
|
|
907
|
+
);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
);
|
|
911
|
+
server.registerTool(
|
|
912
|
+
track(mcpToolName(ctx.productName, "documents_review")),
|
|
913
|
+
{
|
|
914
|
+
title: "Review Document",
|
|
915
|
+
description: "Accept or reject a submitted document. Supply `rejectionReason` when setting status=REJECTED.",
|
|
916
|
+
inputSchema: {
|
|
917
|
+
id: z.string().describe("Document ID"),
|
|
918
|
+
status: DocumentStatusEnum.describe("Review outcome (ACCEPTED/PENDING/REJECTED)"),
|
|
919
|
+
rejectionReason: z.string().optional().describe("Reason when rejecting")
|
|
920
|
+
}
|
|
921
|
+
},
|
|
922
|
+
async ({ id, status, rejectionReason }) => {
|
|
923
|
+
try {
|
|
924
|
+
const data = await ctx.gql.workspace.request(REVIEW_DOCUMENT, { id, status, rejectionReason });
|
|
925
|
+
return jsonResult(data.govReviewDocument);
|
|
926
|
+
} catch (error) {
|
|
927
|
+
ctx.logger.error("govcitizenhub documents_review failed", { error: String(error) });
|
|
928
|
+
return errorResult(
|
|
929
|
+
`Failed to review document: ${error instanceof Error ? error.message : String(error)}`
|
|
930
|
+
);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
);
|
|
934
|
+
}
|
|
935
|
+
function registerNoteTools(server, ctx, track) {
|
|
936
|
+
server.registerTool(
|
|
937
|
+
track(mcpToolName(ctx.productName, "case_notes_add")),
|
|
938
|
+
{
|
|
939
|
+
title: "Add Case Note",
|
|
940
|
+
description: "Add a case note to an application. `type` controls visibility/intent: INTERNAL (staff-only), CITIZEN_MESSAGE, INFO_REQUEST, or DECISION. The author identity comes from the gateway actor headers.",
|
|
941
|
+
inputSchema: {
|
|
942
|
+
applicationId: z.string().min(1).describe("Application the note belongs to"),
|
|
943
|
+
body: z.string().min(1).describe("Note body text"),
|
|
944
|
+
type: CaseNoteTypeEnum.optional().describe("Note type (default INTERNAL)")
|
|
945
|
+
}
|
|
946
|
+
},
|
|
947
|
+
async ({ applicationId, body, type }) => {
|
|
948
|
+
try {
|
|
949
|
+
const input = { applicationId, body };
|
|
950
|
+
if (type !== void 0) input.type = type;
|
|
951
|
+
const data = await ctx.gql.workspace.request(ADD_CASE_NOTE, { input });
|
|
952
|
+
return jsonResult(data.govAddCaseNote);
|
|
953
|
+
} catch (error) {
|
|
954
|
+
ctx.logger.error("govcitizenhub notes_add failed", { error: String(error) });
|
|
955
|
+
return errorResult(
|
|
956
|
+
`Failed to add case note: ${error instanceof Error ? error.message : String(error)}`
|
|
957
|
+
);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
);
|
|
961
|
+
}
|
|
962
|
+
function registerPermitTools(server, ctx, track) {
|
|
963
|
+
server.registerTool(
|
|
964
|
+
track(mcpToolName(ctx.productName, "permits_list")),
|
|
965
|
+
{
|
|
966
|
+
title: "List Permits",
|
|
967
|
+
description: "List issued permits in the bound workspace, optionally filtered by holder, service, or status.",
|
|
968
|
+
inputSchema: {
|
|
969
|
+
holderId: z.string().optional().describe("Filter by permit holder user ID"),
|
|
970
|
+
serviceId: z.string().optional().describe("Filter by service ID"),
|
|
971
|
+
status: PermitStatusEnum.optional().describe("Filter by permit status")
|
|
972
|
+
}
|
|
973
|
+
},
|
|
974
|
+
async ({ holderId, serviceId, status }) => {
|
|
975
|
+
try {
|
|
976
|
+
const data = await ctx.gql.workspace.request(LIST_PERMITS, { holderId, serviceId, status });
|
|
977
|
+
return jsonResult(data.govListPermits);
|
|
978
|
+
} catch (error) {
|
|
979
|
+
ctx.logger.error("govcitizenhub permits_list failed", { error: String(error) });
|
|
980
|
+
return errorResult(
|
|
981
|
+
`Failed to list permits: ${error instanceof Error ? error.message : String(error)}`
|
|
982
|
+
);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
);
|
|
986
|
+
server.registerTool(
|
|
987
|
+
track(mcpToolName(ctx.productName, "permits_verify")),
|
|
988
|
+
{
|
|
989
|
+
title: "Verify Permit",
|
|
990
|
+
description: "Public permit verification by its printed verification code (citizen-facing trust check). Returns the permit or null if no match.",
|
|
991
|
+
inputSchema: {
|
|
992
|
+
verificationCode: z.string().min(1).describe("The printed permit verification code")
|
|
993
|
+
}
|
|
994
|
+
},
|
|
995
|
+
async ({ verificationCode }) => {
|
|
996
|
+
try {
|
|
997
|
+
const data = await ctx.gql.workspace.request(VERIFY_PERMIT, { verificationCode });
|
|
998
|
+
if (!data.govVerifyPermit) {
|
|
999
|
+
return errorResult(`No permit found for verification code ${verificationCode}`);
|
|
1000
|
+
}
|
|
1001
|
+
return jsonResult(data.govVerifyPermit);
|
|
1002
|
+
} catch (error) {
|
|
1003
|
+
ctx.logger.error("govcitizenhub permits_verify failed", { error: String(error) });
|
|
1004
|
+
return errorResult(
|
|
1005
|
+
`Failed to verify permit: ${error instanceof Error ? error.message : String(error)}`
|
|
1006
|
+
);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
);
|
|
1010
|
+
server.registerTool(
|
|
1011
|
+
track(mcpToolName(ctx.productName, "permits_issue")),
|
|
1012
|
+
{
|
|
1013
|
+
title: "Issue Permit",
|
|
1014
|
+
description: "Issue a permit/licence to a holder for a service. `verificationCode` must be unique; optionally tie it to the originating application and an expiry.",
|
|
1015
|
+
inputSchema: {
|
|
1016
|
+
serviceId: z.string().min(1).describe("Service the permit is issued under"),
|
|
1017
|
+
holderId: z.string().min(1).describe("User ID of the permit holder"),
|
|
1018
|
+
title: z.string().min(1).describe("Permit title"),
|
|
1019
|
+
verificationCode: z.string().min(1).describe("Unique printed verification code"),
|
|
1020
|
+
applicationId: z.string().optional().describe("Originating application ID"),
|
|
1021
|
+
fileId: z.string().optional().describe("wspace-files-svc File ID of the permit PDF"),
|
|
1022
|
+
expiresAt: z.string().optional().describe("Expiry timestamp (ISO 8601)")
|
|
1023
|
+
}
|
|
1024
|
+
},
|
|
1025
|
+
async ({ serviceId, holderId, title, verificationCode, applicationId, fileId, expiresAt }) => {
|
|
1026
|
+
try {
|
|
1027
|
+
const input = { serviceId, holderId, title, verificationCode };
|
|
1028
|
+
if (applicationId !== void 0) input.applicationId = applicationId;
|
|
1029
|
+
if (fileId !== void 0) input.fileId = fileId;
|
|
1030
|
+
if (expiresAt !== void 0) input.expiresAt = expiresAt;
|
|
1031
|
+
const data = await ctx.gql.workspace.request(ISSUE_PERMIT, { input });
|
|
1032
|
+
return jsonResult(data.govIssuePermit);
|
|
1033
|
+
} catch (error) {
|
|
1034
|
+
ctx.logger.error("govcitizenhub permits_issue failed", { error: String(error) });
|
|
1035
|
+
return errorResult(
|
|
1036
|
+
`Failed to issue permit: ${error instanceof Error ? error.message : String(error)}`
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
);
|
|
1041
|
+
server.registerTool(
|
|
1042
|
+
track(mcpToolName(ctx.productName, "permits_revoke")),
|
|
1043
|
+
{
|
|
1044
|
+
title: "Revoke Permit",
|
|
1045
|
+
description: "Revoke an issued permit. `reason` is recorded with the revocation.",
|
|
1046
|
+
inputSchema: {
|
|
1047
|
+
id: z.string().describe("Permit ID"),
|
|
1048
|
+
reason: z.string().optional().describe("Reason for revocation")
|
|
1049
|
+
}
|
|
1050
|
+
},
|
|
1051
|
+
async ({ id, reason }) => {
|
|
1052
|
+
try {
|
|
1053
|
+
const data = await ctx.gql.workspace.request(REVOKE_PERMIT, { id, reason });
|
|
1054
|
+
return jsonResult(data.govRevokePermit);
|
|
1055
|
+
} catch (error) {
|
|
1056
|
+
ctx.logger.error("govcitizenhub permits_revoke failed", { error: String(error) });
|
|
1057
|
+
return errorResult(
|
|
1058
|
+
`Failed to revoke permit: ${error instanceof Error ? error.message : String(error)}`
|
|
1059
|
+
);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
);
|
|
1063
|
+
}
|
|
1064
|
+
function registerGrievanceTools(server, ctx, track) {
|
|
1065
|
+
server.registerTool(
|
|
1066
|
+
track(mcpToolName(ctx.productName, "grievances_get")),
|
|
1067
|
+
{
|
|
1068
|
+
title: "Get Grievance",
|
|
1069
|
+
description: "Fetch a single GovCitizenHub civic grievance by ID.",
|
|
1070
|
+
inputSchema: { id: z.string().describe("Grievance ID") }
|
|
1071
|
+
},
|
|
1072
|
+
async ({ id }) => {
|
|
1073
|
+
try {
|
|
1074
|
+
const data = await ctx.gql.workspace.request(GET_GRIEVANCE, { id });
|
|
1075
|
+
if (!data.govGrievance) return errorResult(`Grievance ${id} not found`);
|
|
1076
|
+
return jsonResult(data.govGrievance);
|
|
1077
|
+
} catch (error) {
|
|
1078
|
+
ctx.logger.error("govcitizenhub grievances_get failed", { error: String(error) });
|
|
1079
|
+
return errorResult(
|
|
1080
|
+
`Failed to get grievance: ${error instanceof Error ? error.message : String(error)}`
|
|
1081
|
+
);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
);
|
|
1085
|
+
server.registerTool(
|
|
1086
|
+
track(mcpToolName(ctx.productName, "grievances_list")),
|
|
1087
|
+
{
|
|
1088
|
+
title: "List Grievances",
|
|
1089
|
+
description: "List civic grievances with optional agency/reporter/status filters and pagination. Returns a connection ({ items, pageInfo }).",
|
|
1090
|
+
inputSchema: {
|
|
1091
|
+
agencyId: z.string().optional().describe("Filter by responsible agency ID"),
|
|
1092
|
+
reporterId: z.string().optional().describe("Filter by reporter (citizen) user ID"),
|
|
1093
|
+
status: GrievanceStatusEnum.optional().describe("Filter by resolution status"),
|
|
1094
|
+
limit: z.number().int().optional().describe("Page size (default 50)"),
|
|
1095
|
+
offset: z.number().int().optional().describe("Pagination offset (default 0)"),
|
|
1096
|
+
cursor: z.string().optional().describe("Opaque pagination cursor")
|
|
1097
|
+
}
|
|
1098
|
+
},
|
|
1099
|
+
async ({ agencyId, reporterId, status, limit, offset, cursor }) => {
|
|
1100
|
+
try {
|
|
1101
|
+
const data = await ctx.gql.workspace.request(LIST_GRIEVANCES, {
|
|
1102
|
+
agencyId,
|
|
1103
|
+
reporterId,
|
|
1104
|
+
status,
|
|
1105
|
+
pagination: buildPagination({ limit, offset, cursor })
|
|
1106
|
+
});
|
|
1107
|
+
return jsonResult(data.govListGrievances);
|
|
1108
|
+
} catch (error) {
|
|
1109
|
+
ctx.logger.error("govcitizenhub grievances_list failed", { error: String(error) });
|
|
1110
|
+
return errorResult(
|
|
1111
|
+
`Failed to list grievances: ${error instanceof Error ? error.message : String(error)}`
|
|
1112
|
+
);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
);
|
|
1116
|
+
server.registerTool(
|
|
1117
|
+
track(mcpToolName(ctx.productName, "grievances_report")),
|
|
1118
|
+
{
|
|
1119
|
+
title: "Report Grievance",
|
|
1120
|
+
description: "File a new civic grievance. The reporter identity comes from the gateway actor headers. Optionally geotag it (location/latitude/longitude) and attach photo File IDs.",
|
|
1121
|
+
inputSchema: {
|
|
1122
|
+
title: z.string().min(1).describe("Grievance title"),
|
|
1123
|
+
description: z.string().min(1).describe("Detailed description"),
|
|
1124
|
+
category: ServiceCategoryEnum.optional().describe("Category (default GRIEVANCES)"),
|
|
1125
|
+
priority: CasePriorityEnum.optional().describe("Priority (default NORMAL)"),
|
|
1126
|
+
agencyId: z.string().optional().describe("Responsible agency ID"),
|
|
1127
|
+
location: z.string().optional().describe("Human-readable location"),
|
|
1128
|
+
latitude: z.number().optional().describe("Latitude"),
|
|
1129
|
+
longitude: z.number().optional().describe("Longitude"),
|
|
1130
|
+
photoFileIds: z.array(z.string()).optional().describe("wspace-files-svc File IDs for attached photos"),
|
|
1131
|
+
tags: z.array(z.string()).optional().describe("Free-form tags")
|
|
1132
|
+
}
|
|
1133
|
+
},
|
|
1134
|
+
async ({
|
|
1135
|
+
title,
|
|
1136
|
+
description,
|
|
1137
|
+
category,
|
|
1138
|
+
priority,
|
|
1139
|
+
agencyId,
|
|
1140
|
+
location,
|
|
1141
|
+
latitude,
|
|
1142
|
+
longitude,
|
|
1143
|
+
photoFileIds,
|
|
1144
|
+
tags
|
|
1145
|
+
}) => {
|
|
1146
|
+
try {
|
|
1147
|
+
const input = { title, description };
|
|
1148
|
+
if (category !== void 0) input.category = category;
|
|
1149
|
+
if (priority !== void 0) input.priority = priority;
|
|
1150
|
+
if (agencyId !== void 0) input.agencyId = agencyId;
|
|
1151
|
+
if (location !== void 0) input.location = location;
|
|
1152
|
+
if (latitude !== void 0) input.latitude = latitude;
|
|
1153
|
+
if (longitude !== void 0) input.longitude = longitude;
|
|
1154
|
+
if (photoFileIds !== void 0) input.photoFileIds = photoFileIds;
|
|
1155
|
+
if (tags !== void 0) input.tags = tags;
|
|
1156
|
+
const data = await ctx.gql.workspace.request(REPORT_GRIEVANCE, { input });
|
|
1157
|
+
return jsonResult(data.govReportGrievance);
|
|
1158
|
+
} catch (error) {
|
|
1159
|
+
ctx.logger.error("govcitizenhub grievances_report failed", { error: String(error) });
|
|
1160
|
+
return errorResult(
|
|
1161
|
+
`Failed to report grievance: ${error instanceof Error ? error.message : String(error)}`
|
|
1162
|
+
);
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
);
|
|
1166
|
+
server.registerTool(
|
|
1167
|
+
track(mcpToolName(ctx.productName, "grievances_update")),
|
|
1168
|
+
{
|
|
1169
|
+
title: "Update Grievance",
|
|
1170
|
+
description: "Update a grievance. At least one mutable field must be provided. Use `assignedToId` to assign an owner and `agencyId` to route it.",
|
|
1171
|
+
inputSchema: {
|
|
1172
|
+
id: z.string().describe("Grievance ID"),
|
|
1173
|
+
assignedToId: z.string().optional().describe("Assigned owner user ID"),
|
|
1174
|
+
agencyId: z.string().optional().describe("Responsible agency ID"),
|
|
1175
|
+
priority: CasePriorityEnum.optional().describe("Updated priority"),
|
|
1176
|
+
location: z.string().optional().describe("Updated location"),
|
|
1177
|
+
tags: z.array(z.string()).optional().describe("Updated tags")
|
|
1178
|
+
}
|
|
1179
|
+
},
|
|
1180
|
+
async ({ id, assignedToId, agencyId, priority, location, tags }) => {
|
|
1181
|
+
try {
|
|
1182
|
+
const input = {};
|
|
1183
|
+
if (assignedToId !== void 0) input.assignedToId = assignedToId;
|
|
1184
|
+
if (agencyId !== void 0) input.agencyId = agencyId;
|
|
1185
|
+
if (priority !== void 0) input.priority = priority;
|
|
1186
|
+
if (location !== void 0) input.location = location;
|
|
1187
|
+
if (tags !== void 0) input.tags = tags;
|
|
1188
|
+
if (Object.keys(input).length === 0) {
|
|
1189
|
+
return errorResult(
|
|
1190
|
+
"No updates specified \u2014 provide at least one of assignedToId/agencyId/priority/location/tags"
|
|
1191
|
+
);
|
|
1192
|
+
}
|
|
1193
|
+
const data = await ctx.gql.workspace.request(UPDATE_GRIEVANCE, { id, input });
|
|
1194
|
+
return jsonResult(data.govUpdateGrievance);
|
|
1195
|
+
} catch (error) {
|
|
1196
|
+
ctx.logger.error("govcitizenhub grievances_update failed", { error: String(error) });
|
|
1197
|
+
return errorResult(
|
|
1198
|
+
`Failed to update grievance: ${error instanceof Error ? error.message : String(error)}`
|
|
1199
|
+
);
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
);
|
|
1203
|
+
server.registerTool(
|
|
1204
|
+
track(mcpToolName(ctx.productName, "grievances_transition")),
|
|
1205
|
+
{
|
|
1206
|
+
title: "Transition Grievance",
|
|
1207
|
+
description: "Advance a grievance through its resolution lifecycle (OPEN \u2192 ACKNOWLEDGED \u2192 IN_PROGRESS \u2192 RESOLVED/CLOSED/REJECTED) with validated transitions. `resolution` is recorded on resolve.",
|
|
1208
|
+
inputSchema: {
|
|
1209
|
+
id: z.string().describe("Grievance ID"),
|
|
1210
|
+
status: GrievanceStatusEnum.describe("Target resolution status"),
|
|
1211
|
+
resolution: z.string().optional().describe("Resolution note")
|
|
1212
|
+
}
|
|
1213
|
+
},
|
|
1214
|
+
async ({ id, status, resolution }) => {
|
|
1215
|
+
try {
|
|
1216
|
+
const data = await ctx.gql.workspace.request(TRANSITION_GRIEVANCE, { id, status, resolution });
|
|
1217
|
+
return jsonResult(data.govTransitionGrievance);
|
|
1218
|
+
} catch (error) {
|
|
1219
|
+
ctx.logger.error("govcitizenhub grievances_transition failed", { error: String(error) });
|
|
1220
|
+
return errorResult(
|
|
1221
|
+
`Failed to transition grievance: ${error instanceof Error ? error.message : String(error)}`
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
);
|
|
1226
|
+
}
|
|
1227
|
+
function registerPaymentTools(server, ctx, track) {
|
|
1228
|
+
server.registerTool(
|
|
1229
|
+
track(mcpToolName(ctx.productName, "payments_get")),
|
|
1230
|
+
{
|
|
1231
|
+
title: "Get Payment",
|
|
1232
|
+
description: "Fetch a single GovCitizenHub fee payment by ID.",
|
|
1233
|
+
inputSchema: { id: z.string().describe("Payment ID") }
|
|
1234
|
+
},
|
|
1235
|
+
async ({ id }) => {
|
|
1236
|
+
try {
|
|
1237
|
+
const data = await ctx.gql.workspace.request(GET_PAYMENT, { id });
|
|
1238
|
+
if (!data.govPayment) return errorResult(`Payment ${id} not found`);
|
|
1239
|
+
return jsonResult(data.govPayment);
|
|
1240
|
+
} catch (error) {
|
|
1241
|
+
ctx.logger.error("govcitizenhub payments_get failed", { error: String(error) });
|
|
1242
|
+
return errorResult(
|
|
1243
|
+
`Failed to get payment: ${error instanceof Error ? error.message : String(error)}`
|
|
1244
|
+
);
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
);
|
|
1248
|
+
server.registerTool(
|
|
1249
|
+
track(mcpToolName(ctx.productName, "payments_list")),
|
|
1250
|
+
{
|
|
1251
|
+
title: "List Payments",
|
|
1252
|
+
description: "List fee payments with optional application/payer/status filters and pagination. Returns a connection ({ items, pageInfo }).",
|
|
1253
|
+
inputSchema: {
|
|
1254
|
+
applicationId: z.string().optional().describe("Filter by application ID"),
|
|
1255
|
+
payerId: z.string().optional().describe("Filter by payer user ID"),
|
|
1256
|
+
status: PaymentStatusEnum.optional().describe("Filter by payment status"),
|
|
1257
|
+
limit: z.number().int().optional().describe("Page size (default 50)"),
|
|
1258
|
+
offset: z.number().int().optional().describe("Pagination offset (default 0)"),
|
|
1259
|
+
cursor: z.string().optional().describe("Opaque pagination cursor")
|
|
1260
|
+
}
|
|
1261
|
+
},
|
|
1262
|
+
async ({ applicationId, payerId, status, limit, offset, cursor }) => {
|
|
1263
|
+
try {
|
|
1264
|
+
const data = await ctx.gql.workspace.request(LIST_PAYMENTS, {
|
|
1265
|
+
applicationId,
|
|
1266
|
+
payerId,
|
|
1267
|
+
status,
|
|
1268
|
+
pagination: buildPagination({ limit, offset, cursor })
|
|
1269
|
+
});
|
|
1270
|
+
return jsonResult(data.govListPayments);
|
|
1271
|
+
} catch (error) {
|
|
1272
|
+
ctx.logger.error("govcitizenhub payments_list failed", { error: String(error) });
|
|
1273
|
+
return errorResult(
|
|
1274
|
+
`Failed to list payments: ${error instanceof Error ? error.message : String(error)}`
|
|
1275
|
+
);
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
);
|
|
1279
|
+
server.registerTool(
|
|
1280
|
+
track(mcpToolName(ctx.productName, "payments_create")),
|
|
1281
|
+
{
|
|
1282
|
+
title: "Create Payment",
|
|
1283
|
+
description: "Record a fee payment (created PENDING). Optionally tie it to an application and supply itemised lineItems JSON. The payer identity comes from the gateway actor headers.",
|
|
1284
|
+
inputSchema: {
|
|
1285
|
+
amount: z.number().describe("Payment amount"),
|
|
1286
|
+
applicationId: z.string().optional().describe("Application the fee is for"),
|
|
1287
|
+
currency: z.string().optional().describe("ISO currency code"),
|
|
1288
|
+
providerRef: z.string().optional().describe("External payment-provider reference"),
|
|
1289
|
+
lineItems: JsonObject.optional().describe("Itemised line-items JSON")
|
|
1290
|
+
}
|
|
1291
|
+
},
|
|
1292
|
+
async ({ amount, applicationId, currency, providerRef, lineItems }) => {
|
|
1293
|
+
try {
|
|
1294
|
+
const input = { amount };
|
|
1295
|
+
if (applicationId !== void 0) input.applicationId = applicationId;
|
|
1296
|
+
if (currency !== void 0) input.currency = currency;
|
|
1297
|
+
if (providerRef !== void 0) input.providerRef = providerRef;
|
|
1298
|
+
if (lineItems !== void 0) input.lineItems = lineItems;
|
|
1299
|
+
const data = await ctx.gql.workspace.request(CREATE_PAYMENT, { input });
|
|
1300
|
+
return jsonResult(data.govCreatePayment);
|
|
1301
|
+
} catch (error) {
|
|
1302
|
+
ctx.logger.error("govcitizenhub payments_create failed", { error: String(error) });
|
|
1303
|
+
return errorResult(
|
|
1304
|
+
`Failed to create payment: ${error instanceof Error ? error.message : String(error)}`
|
|
1305
|
+
);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
);
|
|
1309
|
+
server.registerTool(
|
|
1310
|
+
track(mcpToolName(ctx.productName, "payments_mark_paid")),
|
|
1311
|
+
{
|
|
1312
|
+
title: "Mark Payment Paid",
|
|
1313
|
+
description: "Mark a pending payment as PAID, optionally recording the external provider reference.",
|
|
1314
|
+
inputSchema: {
|
|
1315
|
+
id: z.string().describe("Payment ID"),
|
|
1316
|
+
providerRef: z.string().optional().describe("External payment-provider reference")
|
|
1317
|
+
}
|
|
1318
|
+
},
|
|
1319
|
+
async ({ id, providerRef }) => {
|
|
1320
|
+
try {
|
|
1321
|
+
const data = await ctx.gql.workspace.request(MARK_PAYMENT_PAID, { id, providerRef });
|
|
1322
|
+
return jsonResult(data.govMarkPaymentPaid);
|
|
1323
|
+
} catch (error) {
|
|
1324
|
+
ctx.logger.error("govcitizenhub payments_mark_paid failed", { error: String(error) });
|
|
1325
|
+
return errorResult(
|
|
1326
|
+
`Failed to mark payment paid: ${error instanceof Error ? error.message : String(error)}`
|
|
1327
|
+
);
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
);
|
|
1331
|
+
server.registerTool(
|
|
1332
|
+
track(mcpToolName(ctx.productName, "payments_refund")),
|
|
1333
|
+
{
|
|
1334
|
+
title: "Refund Payment",
|
|
1335
|
+
description: "Refund a paid payment (moves it to REFUNDED).",
|
|
1336
|
+
inputSchema: { id: z.string().describe("Payment ID") }
|
|
1337
|
+
},
|
|
1338
|
+
async ({ id }) => {
|
|
1339
|
+
try {
|
|
1340
|
+
const data = await ctx.gql.workspace.request(REFUND_PAYMENT, { id });
|
|
1341
|
+
return jsonResult(data.govRefundPayment);
|
|
1342
|
+
} catch (error) {
|
|
1343
|
+
ctx.logger.error("govcitizenhub payments_refund failed", { error: String(error) });
|
|
1344
|
+
return errorResult(
|
|
1345
|
+
`Failed to refund payment: ${error instanceof Error ? error.message : String(error)}`
|
|
1346
|
+
);
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
);
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
// src/modules/govcitizenhub/tools/health.ts
|
|
1353
|
+
function registerHealthTools(server, ctx, track) {
|
|
1354
|
+
server.registerTool(
|
|
1355
|
+
track(mcpToolName(ctx.productName, "health")),
|
|
1356
|
+
{
|
|
1357
|
+
title: "GovCitizenHub Health Check",
|
|
1358
|
+
description: "Public health probe for the GovCitizenHub subgraph (govHealth). Requires no authentication.",
|
|
1359
|
+
inputSchema: {}
|
|
1360
|
+
},
|
|
1361
|
+
async () => {
|
|
1362
|
+
try {
|
|
1363
|
+
const data = await ctx.gql.workspace.request(HEALTH, {});
|
|
1364
|
+
return jsonResult({ ok: true, status: data.govHealth });
|
|
1365
|
+
} catch (error) {
|
|
1366
|
+
ctx.logger.error("govcitizenhub health failed", { error: String(error) });
|
|
1367
|
+
return errorResult(
|
|
1368
|
+
`GovCitizenHub health check failed: ${error instanceof Error ? error.message : String(error)}`
|
|
1369
|
+
);
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
);
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
// src/modules/govcitizenhub/resources.ts
|
|
1376
|
+
function registerGovcitizenhubResources(server, ctx, track) {
|
|
1377
|
+
const schemaUri = track(mcpResourceUri(ctx.productName, "schema"));
|
|
1378
|
+
const agenciesUri = track(mcpResourceUri(ctx.productName, "agencies"));
|
|
1379
|
+
const servicesUri = track(mcpResourceUri(ctx.productName, "services"));
|
|
1380
|
+
server.registerResource(
|
|
1381
|
+
"govcitizenhub-schema",
|
|
1382
|
+
schemaUri,
|
|
1383
|
+
{
|
|
1384
|
+
title: "GovCitizenHub Domain Schema",
|
|
1385
|
+
description: "Overview of the GovCitizenHub domain \u2014 entities, enums, and the per-entity tool surface.",
|
|
1386
|
+
mimeType: "text/plain"
|
|
1387
|
+
},
|
|
1388
|
+
async () => {
|
|
1389
|
+
ctx.logger.debug(`Resource ${schemaUri} requested`);
|
|
1390
|
+
const schema = `# GovCitizenHub Domain (Overview)
|
|
1391
|
+
|
|
1392
|
+
Government & Citizen Services Operating System \u2014 a unified catalog of public
|
|
1393
|
+
services, citizen applications, casework and permits, fee payments, and civic
|
|
1394
|
+
grievances.
|
|
1395
|
+
|
|
1396
|
+
## Entities
|
|
1397
|
+
- GovAgency \u2014 a government agency (operates services)
|
|
1398
|
+
- GovService \u2014 a public service in the catalog (fee model, SLA, required docs)
|
|
1399
|
+
- GovApplication \u2014 a citizen application against a service (+documents, notes, permits)
|
|
1400
|
+
- GovDocument \u2014 a supporting document on an application (references a Files-svc File)
|
|
1401
|
+
- GovCaseNote \u2014 a casework note on an application
|
|
1402
|
+
- GovPermit \u2014 an issued permit/licence (publicly verifiable by code)
|
|
1403
|
+
- GovGrievance \u2014 a civic grievance report
|
|
1404
|
+
- GovPayment \u2014 a fee payment against an application
|
|
1405
|
+
|
|
1406
|
+
## Enums
|
|
1407
|
+
- GovServiceCategory: CERTIFICATES, EDUCATION, GRIEVANCES, HEALTH, LICENCES_AND_PERMITS, OTHER, SOCIAL_WELFARE, TAXES_AND_PAYMENTS, UTILITIES
|
|
1408
|
+
- GovServiceStatus: DRAFT, PUBLISHED, RETIRED, SUSPENDED
|
|
1409
|
+
- GovFeeType: FIXED, FREE, VARIABLE
|
|
1410
|
+
- GovApplicationStatus: DRAFT, SUBMITTED, IN_REVIEW, INFO_REQUESTED, APPROVED, REJECTED, WITHDRAWN
|
|
1411
|
+
- GovCasePriority: LOW, NORMAL, HIGH, URGENT
|
|
1412
|
+
- GovCaseNoteType: INTERNAL, CITIZEN_MESSAGE, INFO_REQUEST, DECISION
|
|
1413
|
+
- GovDocumentStatus: PENDING, ACCEPTED, REJECTED
|
|
1414
|
+
- GovGrievanceStatus: OPEN, ACKNOWLEDGED, IN_PROGRESS, RESOLVED, CLOSED, REJECTED
|
|
1415
|
+
- GovPaymentStatus: PENDING, PAID, FAILED, REFUNDED
|
|
1416
|
+
- GovPermitStatus: ISSUED, ACTIVE, EXPIRED, REVOKED
|
|
1417
|
+
|
|
1418
|
+
## Tool groups
|
|
1419
|
+
agencies, services, applications, documents, notes, permits, grievances, payments, health.
|
|
1420
|
+
All run against the WORKSPACE gateway (workspace-scoped) except the public health probe
|
|
1421
|
+
and the public permit-verification check.
|
|
1422
|
+
`;
|
|
1423
|
+
return {
|
|
1424
|
+
contents: [{ uri: schemaUri, text: schema, mimeType: "text/plain" }]
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1427
|
+
);
|
|
1428
|
+
server.registerResource(
|
|
1429
|
+
"govcitizenhub-agencies",
|
|
1430
|
+
agenciesUri,
|
|
1431
|
+
{
|
|
1432
|
+
title: "GovCitizenHub Agency Directory",
|
|
1433
|
+
description: "The first 50 active government agencies in the bound workspace.",
|
|
1434
|
+
mimeType: "application/json"
|
|
1435
|
+
},
|
|
1436
|
+
async () => {
|
|
1437
|
+
ctx.logger.debug(`Resource ${agenciesUri} requested`);
|
|
1438
|
+
try {
|
|
1439
|
+
const data = await ctx.gql.workspace.request(LIST_AGENCIES, {
|
|
1440
|
+
isActive: true,
|
|
1441
|
+
pagination: { limit: 50, offset: 0 }
|
|
1442
|
+
});
|
|
1443
|
+
return {
|
|
1444
|
+
contents: [
|
|
1445
|
+
{
|
|
1446
|
+
uri: agenciesUri,
|
|
1447
|
+
text: JSON.stringify(data.govListAgencies, null, 2),
|
|
1448
|
+
mimeType: "application/json"
|
|
1449
|
+
}
|
|
1450
|
+
]
|
|
1451
|
+
};
|
|
1452
|
+
} catch (error) {
|
|
1453
|
+
return {
|
|
1454
|
+
contents: [
|
|
1455
|
+
{
|
|
1456
|
+
uri: agenciesUri,
|
|
1457
|
+
text: JSON.stringify({
|
|
1458
|
+
error: error instanceof Error ? error.message : String(error)
|
|
1459
|
+
}),
|
|
1460
|
+
mimeType: "application/json"
|
|
1461
|
+
}
|
|
1462
|
+
]
|
|
1463
|
+
};
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
);
|
|
1467
|
+
server.registerResource(
|
|
1468
|
+
"govcitizenhub-services",
|
|
1469
|
+
servicesUri,
|
|
1470
|
+
{
|
|
1471
|
+
title: "GovCitizenHub Service Catalog",
|
|
1472
|
+
description: "The first 50 published public services in the bound workspace.",
|
|
1473
|
+
mimeType: "application/json"
|
|
1474
|
+
},
|
|
1475
|
+
async () => {
|
|
1476
|
+
ctx.logger.debug(`Resource ${servicesUri} requested`);
|
|
1477
|
+
try {
|
|
1478
|
+
const data = await ctx.gql.workspace.request(LIST_SERVICES, {
|
|
1479
|
+
status: "PUBLISHED",
|
|
1480
|
+
pagination: { limit: 50, offset: 0 }
|
|
1481
|
+
});
|
|
1482
|
+
return {
|
|
1483
|
+
contents: [
|
|
1484
|
+
{
|
|
1485
|
+
uri: servicesUri,
|
|
1486
|
+
text: JSON.stringify(data.govListServices, null, 2),
|
|
1487
|
+
mimeType: "application/json"
|
|
1488
|
+
}
|
|
1489
|
+
]
|
|
1490
|
+
};
|
|
1491
|
+
} catch (error) {
|
|
1492
|
+
return {
|
|
1493
|
+
contents: [
|
|
1494
|
+
{
|
|
1495
|
+
uri: servicesUri,
|
|
1496
|
+
text: JSON.stringify({
|
|
1497
|
+
error: error instanceof Error ? error.message : String(error)
|
|
1498
|
+
}),
|
|
1499
|
+
mimeType: "application/json"
|
|
1500
|
+
}
|
|
1501
|
+
]
|
|
1502
|
+
};
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
);
|
|
1506
|
+
}
|
|
1507
|
+
function registerGovcitizenhubPrompts(server, ctx, track) {
|
|
1508
|
+
const p = ctx.productName;
|
|
1509
|
+
const catalogName = track(mcpPromptName(p, "service-catalog-setup"));
|
|
1510
|
+
const caseworkName = track(mcpPromptName(p, "casework-triage"));
|
|
1511
|
+
server.registerPrompt(
|
|
1512
|
+
catalogName,
|
|
1513
|
+
{
|
|
1514
|
+
title: "Service Catalog Setup",
|
|
1515
|
+
description: "Guide for standing up a GovCitizenHub agency and its public-service catalog end to end: create the agency, add services, then publish them.",
|
|
1516
|
+
argsSchema: {
|
|
1517
|
+
agency: z.string().optional().describe("Agency name"),
|
|
1518
|
+
category: z.string().optional().describe("Primary service category")
|
|
1519
|
+
}
|
|
1520
|
+
},
|
|
1521
|
+
({ agency, category }) => {
|
|
1522
|
+
ctx.logger.debug(`Prompt ${catalogName} called`, { agency, category });
|
|
1523
|
+
const agencyNote = agency ? `Use the agency name "${agency}".` : "Ask the user for the agency name.";
|
|
1524
|
+
const categoryNote = category ? `Use category ${category}.` : "Help the user pick a GovServiceCategory.";
|
|
1525
|
+
return {
|
|
1526
|
+
messages: [
|
|
1527
|
+
{
|
|
1528
|
+
role: "user",
|
|
1529
|
+
content: {
|
|
1530
|
+
type: "text",
|
|
1531
|
+
text: `Help me set up a GovCitizenHub agency and its service catalog.
|
|
1532
|
+
|
|
1533
|
+
1. **Create Agency**: Use ${p}_agencies_create. ${agencyNote} Optionally set code, jurisdiction, and contact details.
|
|
1534
|
+
2. **Add Services**: Use ${p}_services_create for each public service \u2014 ${categoryNote} Provide a unique slug, the fee model (feeType + feeAmount), slaDays, and any requiredDocuments.
|
|
1535
|
+
3. **Verify Catalog**: Use ${p}_services_list filtered by the new agencyId to confirm the draft services.
|
|
1536
|
+
4. **Publish**: Use ${p}_services_transition with status=PUBLISHED for each service that is ready to accept applications.
|
|
1537
|
+
5. **Activate Agency**: If needed, use ${p}_agencies_update to confirm the agency is active.
|
|
1538
|
+
|
|
1539
|
+
Show results at each step and confirm before publishing.`
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
]
|
|
1543
|
+
};
|
|
1544
|
+
}
|
|
1545
|
+
);
|
|
1546
|
+
server.registerPrompt(
|
|
1547
|
+
caseworkName,
|
|
1548
|
+
{
|
|
1549
|
+
title: "Casework Triage",
|
|
1550
|
+
description: "Daily casework workflow: triage the submitted-application queue, request info or review documents, advance applications, issue permits, and handle grievances.",
|
|
1551
|
+
argsSchema: {
|
|
1552
|
+
assignedToId: z.string().optional().describe("Caseworker user ID to triage for")
|
|
1553
|
+
}
|
|
1554
|
+
},
|
|
1555
|
+
({ assignedToId }) => {
|
|
1556
|
+
ctx.logger.debug(`Prompt ${caseworkName} called`, { assignedToId });
|
|
1557
|
+
const assigneeNote = assignedToId ? `Focus on applications assigned to "${assignedToId}".` : `Triage across all caseworkers (omit the assignedToId filter).`;
|
|
1558
|
+
return {
|
|
1559
|
+
messages: [
|
|
1560
|
+
{
|
|
1561
|
+
role: "user",
|
|
1562
|
+
content: {
|
|
1563
|
+
type: "text",
|
|
1564
|
+
text: `Run daily GovCitizenHub casework triage. ${assigneeNote}
|
|
1565
|
+
|
|
1566
|
+
1. **Queue**: Use ${p}_applications_list with status=SUBMITTED (then IN_REVIEW) to find applications awaiting action.
|
|
1567
|
+
2. **Open a Case**: Use ${p}_applications_get to load an application with its documents, notes, and permits.
|
|
1568
|
+
3. **Documents**: Use ${p}_documents_review to ACCEPT/REJECT each submitted document (supply a rejectionReason when rejecting).
|
|
1569
|
+
4. **Communicate**: Use ${p}_case_notes_add with type=INFO_REQUEST to ask the citizen for more, or type=INTERNAL for staff notes.
|
|
1570
|
+
5. **Advance**: Use ${p}_applications_transition to move the case (IN_REVIEW \u2192 INFO_REQUESTED/APPROVED/REJECTED), recording a reason.
|
|
1571
|
+
6. **Issue Permit**: On approval, use ${p}_permits_issue to grant the permit/licence (unique verificationCode), tying it to the application.
|
|
1572
|
+
7. **Payments**: Use ${p}_payments_list to confirm fees are PAID; use ${p}_payments_mark_paid where a provider reference confirms settlement.
|
|
1573
|
+
8. **Grievances**: Use ${p}_grievances_list with status=OPEN and ${p}_grievances_transition to acknowledge/progress/resolve them.
|
|
1574
|
+
|
|
1575
|
+
Summarize what needs attention after each step.`
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
]
|
|
1579
|
+
};
|
|
1580
|
+
}
|
|
1581
|
+
);
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
// src/modules/govcitizenhub/index.ts
|
|
1585
|
+
var govcitizenhubModule = {
|
|
1586
|
+
id: "govcitizenhub",
|
|
1587
|
+
version: "0.0.1",
|
|
1588
|
+
displayName: "GovCitizenHub",
|
|
1589
|
+
dependsOn: ["auth"],
|
|
1590
|
+
capabilities: { tools: {}, resources: {}, prompts: {} },
|
|
1591
|
+
register(server, ctx) {
|
|
1592
|
+
const tools = [];
|
|
1593
|
+
const resources = [];
|
|
1594
|
+
const prompts = [];
|
|
1595
|
+
const trackTool = (n) => {
|
|
1596
|
+
tools.push(n);
|
|
1597
|
+
return n;
|
|
1598
|
+
};
|
|
1599
|
+
const trackResource = (uri) => {
|
|
1600
|
+
resources.push(uri);
|
|
1601
|
+
return uri;
|
|
1602
|
+
};
|
|
1603
|
+
const trackPrompt = (n) => {
|
|
1604
|
+
prompts.push(n);
|
|
1605
|
+
return n;
|
|
1606
|
+
};
|
|
1607
|
+
registerAgencyTools(server, ctx, trackTool);
|
|
1608
|
+
registerServiceTools(server, ctx, trackTool);
|
|
1609
|
+
registerApplicationTools(server, ctx, trackTool);
|
|
1610
|
+
registerDocumentTools(server, ctx, trackTool);
|
|
1611
|
+
registerNoteTools(server, ctx, trackTool);
|
|
1612
|
+
registerPermitTools(server, ctx, trackTool);
|
|
1613
|
+
registerGrievanceTools(server, ctx, trackTool);
|
|
1614
|
+
registerPaymentTools(server, ctx, trackTool);
|
|
1615
|
+
registerHealthTools(server, ctx, trackTool);
|
|
1616
|
+
registerGovcitizenhubResources(server, ctx, trackResource);
|
|
1617
|
+
registerGovcitizenhubPrompts(server, ctx, trackPrompt);
|
|
1618
|
+
return { tools, resources, prompts };
|
|
1619
|
+
}
|
|
1620
|
+
};
|
|
1621
|
+
var govcitizenhub_default = govcitizenhubModule;
|
|
1622
|
+
|
|
1623
|
+
export { govcitizenhub_default as default };
|
|
1624
|
+
//# sourceMappingURL=index.js.map
|
|
1625
|
+
//# sourceMappingURL=index.js.map
|