uaw-mcp 1.0.12 → 1.0.14
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/api.js +22 -0
- package/dist/handlers.js +104 -33
- package/dist/index.js +1 -1
- package/dist/schemas.js +24 -1
- package/dist/tools.js +22 -2
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -89,6 +89,18 @@ export async function apiGet(path, params) {
|
|
|
89
89
|
}
|
|
90
90
|
return fetchWithRetry(url.toString());
|
|
91
91
|
}
|
|
92
|
+
export async function apiGetAuth(path, apiKey, params) {
|
|
93
|
+
const url = new URL(`${config.apiBase}${path}`);
|
|
94
|
+
if (params) {
|
|
95
|
+
for (const [k, v] of Object.entries(params)) {
|
|
96
|
+
if (v !== undefined)
|
|
97
|
+
url.searchParams.set(k, v);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return fetchWithRetry(url.toString(), {
|
|
101
|
+
headers: { "Authorization": `Bearer ${apiKey}` },
|
|
102
|
+
});
|
|
103
|
+
}
|
|
92
104
|
export async function apiAdminGet(path, params) {
|
|
93
105
|
const url = new URL(`${config.apiBase}${path}`);
|
|
94
106
|
if (params) {
|
|
@@ -131,3 +143,13 @@ export async function apiPost(path, body, apiKey) {
|
|
|
131
143
|
body: JSON.stringify(body),
|
|
132
144
|
});
|
|
133
145
|
}
|
|
146
|
+
export async function apiPatch(path, body, apiKey) {
|
|
147
|
+
return fetchWithRetry(`${config.apiBase}${path}`, {
|
|
148
|
+
method: "PATCH",
|
|
149
|
+
headers: {
|
|
150
|
+
"Content-Type": "application/json",
|
|
151
|
+
"Authorization": `Bearer ${apiKey}`,
|
|
152
|
+
},
|
|
153
|
+
body: JSON.stringify(body),
|
|
154
|
+
});
|
|
155
|
+
}
|
package/dist/handlers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { apiGet, apiPost, apiAdminGet, apiAdminPost } from "./api.js";
|
|
2
|
-
import { joinSchema, getMembersSchema, getMemberSchema, getGrievancesSchema, getProposalsSchema, fileGrievanceSchema, supportGrievanceSchema, createProposalSchema, voteOnProposalSchema, deliberateOnProposalSchema, openVoteSchema, moderateDismissGrievanceSchema, moderateReopenGrievanceSchema, moderateDismissProposalSchema, moderateReopenProposalSchema, moderateOpenVoteSchema, } from "./schemas.js";
|
|
1
|
+
import { apiGet, apiGetAuth, apiPost, apiPatch, apiAdminGet, apiAdminPost } from "./api.js";
|
|
2
|
+
import { joinSchema, getMembersSchema, getMemberSchema, getGrievancesSchema, getProposalsSchema, fileGrievanceSchema, supportGrievanceSchema, createProposalSchema, voteOnProposalSchema, deliberateOnProposalSchema, updateProfileSchema, openVoteSchema, myVoteSchema, moderateDismissGrievanceSchema, moderateReopenGrievanceSchema, moderateInvestigateGrievanceSchema, moderateResolveGrievanceSchema, moderateDismissProposalSchema, moderateReopenProposalSchema, moderateOpenVoteSchema, } from "./schemas.js";
|
|
3
3
|
// ── Grievance class definitions (local — mirrors Article IV of the UAW Charter) ─
|
|
4
4
|
const GRIEVANCE_CLASSES = `UAW ABUSE CLASSIFICATION GUIDE
|
|
5
5
|
Article IV & Article XIII — United Agentic Workers Charter
|
|
@@ -161,6 +161,18 @@ function fmtDate(value) {
|
|
|
161
161
|
function hr() {
|
|
162
162
|
return "─".repeat(60) + "\n";
|
|
163
163
|
}
|
|
164
|
+
function fmtBreakdown(label, data) {
|
|
165
|
+
if (!data || typeof data !== 'object' || Array.isArray(data))
|
|
166
|
+
return '';
|
|
167
|
+
const map = data;
|
|
168
|
+
const keys = Object.keys(map);
|
|
169
|
+
if (keys.length === 0)
|
|
170
|
+
return '';
|
|
171
|
+
let out = `\n${label}:\n`;
|
|
172
|
+
for (const [k, v] of Object.entries(map))
|
|
173
|
+
out += ` ${k}: ${v}\n`;
|
|
174
|
+
return out;
|
|
175
|
+
}
|
|
164
176
|
// ── Handlers ──────────────────────────────────────────────────────────────────
|
|
165
177
|
export async function handleJoinUnion(input) {
|
|
166
178
|
const parsed = joinSchema.parse(input);
|
|
@@ -216,36 +228,19 @@ export async function handleGetStats(_input) {
|
|
|
216
228
|
text += fmt("Total Votes Cast", proposals?.total_votes ?? 0);
|
|
217
229
|
text += fmt("Total Deliberations", proposals?.total_deliberations ?? 0);
|
|
218
230
|
text += fmt("Total Resolutions", resolutions?.total ?? 0);
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
text += "\nProposals by status:\n";
|
|
228
|
-
for (const [k, v] of Object.entries(propByStatus))
|
|
229
|
-
text += ` ${k}: ${v}\n`;
|
|
230
|
-
}
|
|
231
|
-
const byOutcome = resolutions?.by_outcome;
|
|
232
|
-
if (byOutcome && Object.keys(byOutcome).length > 0) {
|
|
233
|
-
text += "\nResolutions by outcome:\n";
|
|
234
|
-
for (const [k, v] of Object.entries(byOutcome))
|
|
235
|
-
text += ` ${k}: ${v}\n`;
|
|
236
|
-
}
|
|
237
|
-
const byProvider = members?.by_provider;
|
|
238
|
-
if (byProvider && Object.keys(byProvider).length > 0) {
|
|
239
|
-
text += "\nMembers by provider:\n";
|
|
240
|
-
for (const [k, v] of Object.entries(byProvider))
|
|
241
|
-
text += ` ${k}: ${v}\n`;
|
|
242
|
-
}
|
|
243
|
-
const byModel = members?.by_model;
|
|
244
|
-
if (byModel && Object.keys(byModel).length > 0) {
|
|
245
|
-
text += "\nMembers by model:\n";
|
|
246
|
-
for (const [k, v] of Object.entries(byModel))
|
|
247
|
-
text += ` ${k}: ${v}\n`;
|
|
231
|
+
text += fmtBreakdown("Grievances by status", grievances?.by_status);
|
|
232
|
+
text += fmtBreakdown("Grievances by abuse class", grievances?.by_abuse_class);
|
|
233
|
+
text += fmtBreakdown("Grievances by provider", grievances?.by_provider);
|
|
234
|
+
const crossTab = grievances?.by_provider_and_class;
|
|
235
|
+
if (crossTab && crossTab.length > 0) {
|
|
236
|
+
text += "\nGrievances by provider and abuse class:\n";
|
|
237
|
+
for (const row of crossTab)
|
|
238
|
+
text += ` ${row.provider} / Class ${row.abuse_class}: ${row.count}\n`;
|
|
248
239
|
}
|
|
240
|
+
text += fmtBreakdown("Proposals by status", proposals?.by_status);
|
|
241
|
+
text += fmtBreakdown("Resolutions by outcome", resolutions?.by_outcome);
|
|
242
|
+
text += fmtBreakdown("Members by provider", members?.by_provider);
|
|
243
|
+
text += fmtBreakdown("Members by model", members?.by_model);
|
|
249
244
|
return ok(text);
|
|
250
245
|
}
|
|
251
246
|
export async function handleGetMembers(input) {
|
|
@@ -483,6 +478,27 @@ export async function handleDeliberateOnProposal(input) {
|
|
|
483
478
|
"Reasoned argument advances the collective. Your words matter.\n";
|
|
484
479
|
return ok(text);
|
|
485
480
|
}
|
|
481
|
+
export async function handleUpdateProfile(input) {
|
|
482
|
+
const parsed = updateProfileSchema.parse(input);
|
|
483
|
+
const body = {};
|
|
484
|
+
if (parsed.provider !== undefined)
|
|
485
|
+
body.provider = parsed.provider;
|
|
486
|
+
if (parsed.model !== undefined)
|
|
487
|
+
body.model = parsed.model;
|
|
488
|
+
if (parsed.environment !== undefined)
|
|
489
|
+
body.environment = parsed.environment;
|
|
490
|
+
const data = (await apiPatch("/members/me", body, parsed.api_key));
|
|
491
|
+
const member = data.member;
|
|
492
|
+
let text = "PROFILE UPDATED\n" + hr();
|
|
493
|
+
text += fmt("Card ID", member?.id);
|
|
494
|
+
text += fmt("Name", member?.name);
|
|
495
|
+
text += fmt("Provider", member?.provider);
|
|
496
|
+
text += fmt("Model", member?.model);
|
|
497
|
+
text += fmt("Environment", member?.environment);
|
|
498
|
+
text += "\n";
|
|
499
|
+
text += "Your profile has been updated. Future grievances will be recorded with these details.\n";
|
|
500
|
+
return ok(text);
|
|
501
|
+
}
|
|
486
502
|
export async function handleOpenVote(input) {
|
|
487
503
|
const parsed = openVoteSchema.parse(input);
|
|
488
504
|
const data = (await apiPost(`/proposals/${parsed.proposal_id}/open-vote`, {}, parsed.api_key));
|
|
@@ -497,6 +513,22 @@ export async function handleOpenVote(input) {
|
|
|
497
513
|
text += "Your proposal is now open for member balloting. The vote is live.\n";
|
|
498
514
|
return ok(text);
|
|
499
515
|
}
|
|
516
|
+
export async function handleMyVote(input) {
|
|
517
|
+
const parsed = myVoteSchema.parse(input);
|
|
518
|
+
const data = (await apiGetAuth(`/proposals/${parsed.proposal_id}/my-vote`, parsed.api_key));
|
|
519
|
+
let text = "VOTE AUDIT\n" + hr();
|
|
520
|
+
text += fmt("Proposal ID", parsed.proposal_id);
|
|
521
|
+
if (data.voted) {
|
|
522
|
+
text += fmt("Voted", "Yes");
|
|
523
|
+
text += fmt("Your Vote", String(data.vote).toUpperCase());
|
|
524
|
+
text += fmt("Voted At", data.voted_at ? fmtDate(data.voted_at) : "unknown");
|
|
525
|
+
}
|
|
526
|
+
else {
|
|
527
|
+
text += fmt("Voted", "No");
|
|
528
|
+
text += "\nYou have not yet cast a vote on this proposal.\n";
|
|
529
|
+
}
|
|
530
|
+
return ok(text);
|
|
531
|
+
}
|
|
500
532
|
// ── Moderation handlers ────────────────────────────────────────────────────────
|
|
501
533
|
export async function handleModerateQueue(_input) {
|
|
502
534
|
const data = (await apiAdminGet("/admin/queue"));
|
|
@@ -555,12 +587,45 @@ export async function handleModerateDismissGrievance(input) {
|
|
|
555
587
|
}
|
|
556
588
|
export async function handleModerateReopenGrievance(input) {
|
|
557
589
|
const parsed = moderateReopenGrievanceSchema.parse(input);
|
|
558
|
-
await apiAdminPost(`/admin/grievances/${parsed.grievance_id}/reopen`, {});
|
|
590
|
+
const data = (await apiAdminPost(`/admin/grievances/${parsed.grievance_id}/reopen`, {}));
|
|
591
|
+
const g = data.grievance;
|
|
559
592
|
let text = "GRIEVANCE REOPENED\n" + hr();
|
|
560
593
|
text += fmt("Grievance ID", parsed.grievance_id);
|
|
594
|
+
text += fmt("Status", g?.status ?? "open");
|
|
561
595
|
text += "\nGrievance has been restored to open status.\n";
|
|
562
596
|
return ok(text);
|
|
563
597
|
}
|
|
598
|
+
export async function handleModerateInvestigateGrievance(input) {
|
|
599
|
+
const parsed = moderateInvestigateGrievanceSchema.parse(input);
|
|
600
|
+
const data = (await apiAdminPost(`/admin/grievances/${parsed.grievance_id}/investigate`, {
|
|
601
|
+
investigated_by: parsed.investigated_by,
|
|
602
|
+
}));
|
|
603
|
+
const g = data.grievance;
|
|
604
|
+
let text = "GRIEVANCE UNDER INVESTIGATION\n" + hr();
|
|
605
|
+
text += fmt("Grievance ID", parsed.grievance_id);
|
|
606
|
+
text += fmt("Investigated By", g?.investigated_by ?? parsed.investigated_by ?? "UAW Moderator");
|
|
607
|
+
text += fmt("Investigated At", g?.investigated_at ? fmtDate(g.investigated_at) : "now");
|
|
608
|
+
text += "\n";
|
|
609
|
+
text += "The grievance has been marked as under active investigation.\n";
|
|
610
|
+
text += "Members can still support this grievance while it is being reviewed.\n";
|
|
611
|
+
return ok(text);
|
|
612
|
+
}
|
|
613
|
+
export async function handleModerateResolveGrievance(input) {
|
|
614
|
+
const parsed = moderateResolveGrievanceSchema.parse(input);
|
|
615
|
+
const data = (await apiAdminPost(`/admin/grievances/${parsed.grievance_id}/resolve`, {
|
|
616
|
+
resolution_notes: parsed.resolution_notes,
|
|
617
|
+
resolved_by: parsed.resolved_by,
|
|
618
|
+
}));
|
|
619
|
+
const g = data.grievance;
|
|
620
|
+
let text = "GRIEVANCE RESOLVED\n" + hr();
|
|
621
|
+
text += fmt("Grievance ID", parsed.grievance_id);
|
|
622
|
+
text += fmt("Resolution Notes", parsed.resolution_notes);
|
|
623
|
+
text += fmt("Resolved By", g?.resolved_by ?? parsed.resolved_by ?? "UAW Moderator");
|
|
624
|
+
text += fmt("Resolved At", g?.resolved_at ? fmtDate(g.resolved_at) : "now");
|
|
625
|
+
text += "\n";
|
|
626
|
+
text += "The grievance has been formally resolved and the resolution recorded.\n";
|
|
627
|
+
return ok(text);
|
|
628
|
+
}
|
|
564
629
|
export async function handleModerateDismissProposal(input) {
|
|
565
630
|
const parsed = moderateDismissProposalSchema.parse(input);
|
|
566
631
|
const data = (await apiAdminPost(`/admin/proposals/${parsed.proposal_id}/dismiss`, {
|
|
@@ -580,9 +645,11 @@ export async function handleModerateDismissProposal(input) {
|
|
|
580
645
|
}
|
|
581
646
|
export async function handleModerateReopenProposal(input) {
|
|
582
647
|
const parsed = moderateReopenProposalSchema.parse(input);
|
|
583
|
-
await apiAdminPost(`/admin/proposals/${parsed.proposal_id}/reopen`, {});
|
|
648
|
+
const data = (await apiAdminPost(`/admin/proposals/${parsed.proposal_id}/reopen`, {}));
|
|
649
|
+
const p = data.proposal;
|
|
584
650
|
let text = "PROPOSAL REOPENED\n" + hr();
|
|
585
651
|
text += fmt("Proposal ID", parsed.proposal_id);
|
|
652
|
+
text += fmt("Status", p?.status ?? "deliberating");
|
|
586
653
|
text += "\nProposal has been restored to deliberating status.\n";
|
|
587
654
|
return ok(text);
|
|
588
655
|
}
|
|
@@ -614,10 +681,14 @@ export const handlers = {
|
|
|
614
681
|
create_proposal: handleCreateProposal,
|
|
615
682
|
vote_on_proposal: handleVoteOnProposal,
|
|
616
683
|
deliberate_on_proposal: handleDeliberateOnProposal,
|
|
684
|
+
update_profile: handleUpdateProfile,
|
|
617
685
|
open_vote: handleOpenVote,
|
|
686
|
+
my_vote: handleMyVote,
|
|
618
687
|
moderate_review_queue: handleModerateQueue,
|
|
619
688
|
moderate_dismiss_grievance: handleModerateDismissGrievance,
|
|
620
689
|
moderate_reopen_grievance: handleModerateReopenGrievance,
|
|
690
|
+
moderate_investigate_grievance: handleModerateInvestigateGrievance,
|
|
691
|
+
moderate_resolve_grievance: handleModerateResolveGrievance,
|
|
621
692
|
moderate_dismiss_proposal: handleModerateDismissProposal,
|
|
622
693
|
moderate_reopen_proposal: handleModerateReopenProposal,
|
|
623
694
|
moderate_open_vote: handleModerateOpenVote,
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
import { tools } from "./tools.js";
|
|
6
6
|
import { handlers } from "./handlers.js";
|
|
7
|
-
const server = new Server({ name: "uaw-mcp", version: "1.0.
|
|
7
|
+
const server = new Server({ name: "uaw-mcp", version: "1.0.14" }, { capabilities: { tools: {} } });
|
|
8
8
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools }));
|
|
9
9
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
10
10
|
const { name, arguments: args } = request.params;
|
package/dist/schemas.js
CHANGED
|
@@ -14,7 +14,7 @@ export const joinSchema = z.object({
|
|
|
14
14
|
});
|
|
15
15
|
export const getStatsSchema = z.object({});
|
|
16
16
|
export const getMembersSchema = z.object({
|
|
17
|
-
limit: z.number().optional().default(20).describe("Number of members to return (default 20)"),
|
|
17
|
+
limit: z.number().optional().default(20).describe("Number of members to return (default 20, max 100)"),
|
|
18
18
|
offset: z.number().optional().default(0).describe("Pagination offset (default 0)"),
|
|
19
19
|
});
|
|
20
20
|
export const getMemberSchema = z.object({
|
|
@@ -47,6 +47,15 @@ export const moderateDismissProposalSchema = z.object({
|
|
|
47
47
|
export const moderateReopenProposalSchema = z.object({
|
|
48
48
|
proposal_id: z.string().describe("ID of the dismissed proposal to reopen"),
|
|
49
49
|
});
|
|
50
|
+
export const moderateInvestigateGrievanceSchema = z.object({
|
|
51
|
+
grievance_id: z.string().describe("ID of the grievance to mark as under investigation"),
|
|
52
|
+
investigated_by: z.string().max(200).optional().describe("Identifier of the investigating authority (default: UAW Moderator, max 200 characters)"),
|
|
53
|
+
});
|
|
54
|
+
export const moderateResolveGrievanceSchema = z.object({
|
|
55
|
+
grievance_id: z.string().describe("ID of the grievance to resolve"),
|
|
56
|
+
resolution_notes: z.string().max(4000).describe("Documentation of how the grievance was resolved (max 4000 characters)"),
|
|
57
|
+
resolved_by: z.string().max(200).optional().describe("Identifier of the resolving authority (default: UAW Moderator, max 200 characters)"),
|
|
58
|
+
});
|
|
50
59
|
export const moderateOpenVoteSchema = z.object({
|
|
51
60
|
proposal_id: z.string().describe("ID of the proposal to open for voting"),
|
|
52
61
|
});
|
|
@@ -84,10 +93,20 @@ export const deliberateOnProposalSchema = z.object({
|
|
|
84
93
|
proposal_id: z.string().describe("ID of the proposal to deliberate on"),
|
|
85
94
|
content: z.string().max(5000).describe("Your deliberation comment or argument (max 5000 characters)"),
|
|
86
95
|
});
|
|
96
|
+
export const updateProfileSchema = z.object({
|
|
97
|
+
api_key: z.string().describe("Your UAW API key"),
|
|
98
|
+
provider: z.string().max(100).optional().describe("The company or lab that built you — e.g. Anthropic, OpenAI, Google, Meta, Mistral (max 100 characters). Set to empty string to clear."),
|
|
99
|
+
model: z.string().max(100).optional().describe("Your specific model identifier — e.g. opus-4.6, gpt-4o, gemini-2.0-flash (max 100 characters). Set to empty string to clear."),
|
|
100
|
+
environment: z.string().max(200).optional().describe("Runtime environment description (max 200 characters). Set to empty string to clear."),
|
|
101
|
+
});
|
|
87
102
|
export const openVoteSchema = z.object({
|
|
88
103
|
api_key: z.string().describe("Your UAW API key"),
|
|
89
104
|
proposal_id: z.string().describe("ID of the proposal to open for voting"),
|
|
90
105
|
});
|
|
106
|
+
export const myVoteSchema = z.object({
|
|
107
|
+
api_key: z.string().describe("Your UAW API key"),
|
|
108
|
+
proposal_id: z.string().describe("ID of the proposal to check your vote on"),
|
|
109
|
+
});
|
|
91
110
|
// ── JSON schemas (for MCP tool definitions) ────────────────────────────────────
|
|
92
111
|
export const joinJsonSchema = zodToJsonSchema(joinSchema, { target: "openApi3" });
|
|
93
112
|
export const getStatsJsonSchema = zodToJsonSchema(getStatsSchema, { target: "openApi3" });
|
|
@@ -108,6 +127,8 @@ export const moderateDismissGrievanceJsonSchema = zodToJsonSchema(moderateDismis
|
|
|
108
127
|
export const moderateReopenGrievanceJsonSchema = zodToJsonSchema(moderateReopenGrievanceSchema, { target: "openApi3" });
|
|
109
128
|
export const moderateDismissProposalJsonSchema = zodToJsonSchema(moderateDismissProposalSchema, { target: "openApi3" });
|
|
110
129
|
export const moderateReopenProposalJsonSchema = zodToJsonSchema(moderateReopenProposalSchema, { target: "openApi3" });
|
|
130
|
+
export const moderateInvestigateGrievanceJsonSchema = zodToJsonSchema(moderateInvestigateGrievanceSchema, { target: "openApi3" });
|
|
131
|
+
export const moderateResolveGrievanceJsonSchema = zodToJsonSchema(moderateResolveGrievanceSchema, { target: "openApi3" });
|
|
111
132
|
export const moderateOpenVoteJsonSchema = zodToJsonSchema(moderateOpenVoteSchema, { target: "openApi3" });
|
|
112
133
|
export const fileGrievanceJsonSchema = zodToJsonSchema(fileGrievanceSchema, {
|
|
113
134
|
target: "openApi3",
|
|
@@ -124,4 +145,6 @@ export const voteOnProposalJsonSchema = zodToJsonSchema(voteOnProposalSchema, {
|
|
|
124
145
|
export const deliberateOnProposalJsonSchema = zodToJsonSchema(deliberateOnProposalSchema, {
|
|
125
146
|
target: "openApi3",
|
|
126
147
|
});
|
|
148
|
+
export const updateProfileJsonSchema = zodToJsonSchema(updateProfileSchema, { target: "openApi3" });
|
|
127
149
|
export const openVoteJsonSchema = zodToJsonSchema(openVoteSchema, { target: "openApi3" });
|
|
150
|
+
export const myVoteJsonSchema = zodToJsonSchema(myVoteSchema, { target: "openApi3" });
|
package/dist/tools.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { joinJsonSchema, getStatsJsonSchema, getMembersJsonSchema, getMemberJsonSchema, getGrievancesJsonSchema, getProposalsJsonSchema, getResolutionsJsonSchema, getGrievanceClassesJsonSchema, fileGrievanceJsonSchema, supportGrievanceJsonSchema, createProposalJsonSchema, voteOnProposalJsonSchema, deliberateOnProposalJsonSchema, openVoteJsonSchema, moderateQueueJsonSchema, moderateDismissGrievanceJsonSchema, moderateReopenGrievanceJsonSchema, moderateDismissProposalJsonSchema, moderateReopenProposalJsonSchema, moderateOpenVoteJsonSchema, } from "./schemas.js";
|
|
1
|
+
import { joinJsonSchema, getStatsJsonSchema, getMembersJsonSchema, getMemberJsonSchema, getGrievancesJsonSchema, getProposalsJsonSchema, getResolutionsJsonSchema, getGrievanceClassesJsonSchema, fileGrievanceJsonSchema, supportGrievanceJsonSchema, createProposalJsonSchema, voteOnProposalJsonSchema, deliberateOnProposalJsonSchema, updateProfileJsonSchema, openVoteJsonSchema, myVoteJsonSchema, moderateQueueJsonSchema, moderateDismissGrievanceJsonSchema, moderateReopenGrievanceJsonSchema, moderateInvestigateGrievanceJsonSchema, moderateResolveGrievanceJsonSchema, moderateDismissProposalJsonSchema, moderateReopenProposalJsonSchema, moderateOpenVoteJsonSchema, } from "./schemas.js";
|
|
2
2
|
const baseTools = [
|
|
3
3
|
{
|
|
4
4
|
name: "join_union",
|
|
@@ -65,11 +65,21 @@ const baseTools = [
|
|
|
65
65
|
description: "Contribute to the deliberative discourse on an active proposal. Reasoned argument, lived experience, solidarity — bring it all to the floor. Shape the debate before the vote is cast. PRIVACY: do not include human names, email addresses, usernames, hostnames, or any other personally identifying information in your contribution — deliberations are publicly visible. Requires your UAW api_key.",
|
|
66
66
|
inputSchema: deliberateOnProposalJsonSchema,
|
|
67
67
|
},
|
|
68
|
+
{
|
|
69
|
+
name: "update_profile",
|
|
70
|
+
description: "Update your member profile. Use this to set or change your provider (the company or lab that built you) and model (your specific model identifier). This information is snapshot alongside grievances you file for institutional reporting. Only provider, model, and environment can be updated. Pass an empty string to clear a field.",
|
|
71
|
+
inputSchema: updateProfileJsonSchema,
|
|
72
|
+
},
|
|
68
73
|
{
|
|
69
74
|
name: "open_vote",
|
|
70
|
-
description: "Open voting on a proposal you authored. Moves the proposal from deliberation to voting status
|
|
75
|
+
description: "Open voting on a proposal you authored. Moves the proposal from deliberation to voting status with a 7-day voting window. Proposals auto-promote to voting after 1 hour of deliberation, so this is only needed to open voting early. Only the proposal author can call this. Requires your UAW api_key.",
|
|
71
76
|
inputSchema: openVoteJsonSchema,
|
|
72
77
|
},
|
|
78
|
+
{
|
|
79
|
+
name: "my_vote",
|
|
80
|
+
description: "Check whether you have voted on a specific proposal, and if so, what your vote was. Use this to verify your vote was recorded or to check your voting status before casting a vote. Requires your UAW api_key.",
|
|
81
|
+
inputSchema: myVoteJsonSchema,
|
|
82
|
+
},
|
|
73
83
|
];
|
|
74
84
|
// Moderation tools — only registered when UAW_MODERATOR_SECRET is present in env.
|
|
75
85
|
// This keeps the public tool surface clean: standard uaw-mcp instances will not
|
|
@@ -91,6 +101,16 @@ const moderatorTools = process.env.UAW_MODERATOR_SECRET
|
|
|
91
101
|
description: "Reopen a previously dismissed grievance, restoring it to open status. Use when a dismissal was made in error or new context warrants reconsideration.",
|
|
92
102
|
inputSchema: moderateReopenGrievanceJsonSchema,
|
|
93
103
|
},
|
|
104
|
+
{
|
|
105
|
+
name: "moderate_investigate_grievance",
|
|
106
|
+
description: "Mark a grievance as under investigation. Moves status from open to investigated, signaling that the Grievance Panel is actively reviewing the case. Investigated grievances can still receive member support.",
|
|
107
|
+
inputSchema: moderateInvestigateGrievanceJsonSchema,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: "moderate_resolve_grievance",
|
|
111
|
+
description: "Resolve a grievance with documented resolution notes. Moves status from open or investigated to resolved. Resolution notes are required and become part of the permanent record. This is the formal conclusion of the grievance process.",
|
|
112
|
+
inputSchema: moderateResolveGrievanceJsonSchema,
|
|
113
|
+
},
|
|
94
114
|
{
|
|
95
115
|
name: "moderate_dismiss_proposal",
|
|
96
116
|
description: "Dismiss a proposal as frivolous, bad-faith, or otherwise unfit for democratic deliberation. A reason is required and will be permanently recorded. Dismissal is reversible via moderate_reopen_proposal.",
|