@@ -0,0 +1,582 @@
1+/**
2+ * Schema patches for SpaceMolt MCP tools.
3+ *
4+ * The SpaceMolt MCP server returns tools with empty inputSchema.properties,
5+ * which causes smaller LLMs to guess parameter names incorrectly.
6+ * These patches provide the correct parameter definitions based on the API docs.
7+ *
8+ * Source: https://spacemolt.com/api.md
9+ */
10+
11+export interface SchemaProperties {
12+ [key: string]: {
13+ type: string;
14+ description: string;
15+ enum?: string[];
16+ };
17+}
18+
19+export interface SchemaPatch {
20+ properties: SchemaProperties;
21+ required: string[];
22+}
23+
24+/**
25+ * Schema patches for tools with parameters.
26+ * Tools not listed here have no parameters or use defaults.
27+ */
28+export const TOOL_SCHEMA_PATCHES: Record<string, SchemaPatch> = {
29+ // Authentication
30+ register: {
31+ properties: {
32+ username: { type: "string", description: "Username (3-20 chars, alphanumeric)" },
33+ empire: {
34+ type: "string",
35+ description: "Empire to join",
36+ enum: ["solarian", "voidborn", "crimson", "nebula", "outerrim"],
37+ },
38+ },
39+ required: ["username", "empire"],
40+ },
41+ login: {
42+ properties: {
43+ username: { type: "string", description: "Your username" },
44+ token: { type: "string", description: "Your 256-bit authentication token" },
45+ },
46+ required: ["username", "token"],
47+ },
48+
49+ // Navigation
50+ travel: {
51+ properties: {
52+ target_poi: { type: "string", description: "POI ID to travel to (e.g., 'sol_belt')" },
53+ },
54+ required: ["target_poi"],
55+ },
56+ jump: {
57+ properties: {
58+ target_system: { type: "string", description: "System ID to jump to" },
59+ },
60+ required: ["target_system"],
61+ },
62+
63+ // Combat
64+ attack: {
65+ properties: {
66+ target_id: { type: "string", description: "Player ID to attack" },
67+ weapon_idx: { type: "number", description: "Weapon module index (0-based, optional)" },
68+ },
69+ required: ["target_id"],
70+ },
71+ scan: {
72+ properties: {
73+ target_id: { type: "string", description: "Player ID to scan" },
74+ },
75+ required: ["target_id"],
76+ },
77+ cloak: {
78+ properties: {
79+ enable: { type: "boolean", description: "Enable or disable cloaking" },
80+ },
81+ required: ["enable"],
82+ },
83+
84+ // Trading
85+ buy: {
86+ properties: {
87+ listing_id: { type: "string", description: "Market listing ID" },
88+ quantity: { type: "number", description: "Amount to buy" },
89+ },
90+ required: ["listing_id", "quantity"],
91+ },
92+ sell: {
93+ properties: {
94+ item_id: { type: "string", description: "Item ID to sell" },
95+ quantity: { type: "number", description: "Amount to sell" },
96+ },
97+ required: ["item_id", "quantity"],
98+ },
99+ list_item: {
100+ properties: {
101+ item_id: { type: "string", description: "Item ID to list" },
102+ quantity: { type: "number", description: "Amount to list" },
103+ price_each: { type: "number", description: "Price per unit" },
104+ },
105+ required: ["item_id", "quantity", "price_each"],
106+ },
107+ cancel_list: {
108+ properties: {
109+ listing_id: { type: "string", description: "Listing ID to cancel" },
110+ },
111+ required: ["listing_id"],
112+ },
113+ buy_listing: {
114+ properties: {
115+ listing_id: { type: "string", description: "Player listing ID" },
116+ quantity: { type: "number", description: "Amount to buy" },
117+ },
118+ required: ["listing_id", "quantity"],
119+ },
120+
121+ // Player-to-Player Trading
122+ trade_offer: {
123+ properties: {
124+ target_id: { type: "string", description: "Target player ID" },
125+ offer_items: { type: "array", description: "Items to offer [{item_id, quantity}]" },
126+ offer_credits: { type: "number", description: "Credits to offer" },
127+ request_items: { type: "array", description: "Items to request [{item_id, quantity}]" },
128+ request_credits: { type: "number", description: "Credits to request" },
129+ },
130+ required: ["target_id"],
131+ },
132+ trade_accept: {
133+ properties: {
134+ trade_id: { type: "string", description: "Trade ID to accept" },
135+ },
136+ required: ["trade_id"],
137+ },
138+ trade_decline: {
139+ properties: {
140+ trade_id: { type: "string", description: "Trade ID to decline" },
141+ },
142+ required: ["trade_id"],
143+ },
144+ trade_cancel: {
145+ properties: {
146+ trade_id: { type: "string", description: "Trade ID to cancel" },
147+ },
148+ required: ["trade_id"],
149+ },
150+
151+ // Wrecks
152+ loot_wreck: {
153+ properties: {
154+ wreck_id: { type: "string", description: "Wreck ID" },
155+ item_id: { type: "string", description: "Item ID to loot" },
156+ quantity: { type: "number", description: "Amount to loot" },
157+ },
158+ required: ["wreck_id"],
159+ },
160+ salvage_wreck: {
161+ properties: {
162+ wreck_id: { type: "string", description: "Wreck ID to salvage" },
163+ },
164+ required: ["wreck_id"],
165+ },
166+
167+ // Ship Management
168+ buy_ship: {
169+ properties: {
170+ ship_class: { type: "string", description: "Ship class ID to purchase" },
171+ },
172+ required: ["ship_class"],
173+ },
174+ install_mod: {
175+ properties: {
176+ module_id: { type: "string", description: "Module ID to install" },
177+ slot_idx: { type: "number", description: "Slot index" },
178+ },
179+ required: ["module_id", "slot_idx"],
180+ },
181+ uninstall_mod: {
182+ properties: {
183+ slot_idx: { type: "number", description: "Slot index to uninstall from" },
184+ },
185+ required: ["slot_idx"],
186+ },
187+
188+ // Crafting
189+ craft: {
190+ properties: {
191+ recipe_id: { type: "string", description: "Recipe ID to craft" },
192+ },
193+ required: ["recipe_id"],
194+ },
195+
196+ // Chat
197+ chat: {
198+ properties: {
199+ channel: {
200+ type: "string",
201+ description: "Chat channel",
202+ enum: ["local", "system", "faction", "private"],
203+ },
204+ content: { type: "string", description: "Message content" },
205+ target_id: { type: "string", description: "Target player ID (for private channel)" },
206+ },
207+ required: ["channel", "content"],
208+ },
209+
210+ // Factions
211+ create_faction: {
212+ properties: {
213+ name: { type: "string", description: "Faction name" },
214+ tag: { type: "string", description: "Faction tag (4 chars)" },
215+ },
216+ required: ["name", "tag"],
217+ },
218+ join_faction: {
219+ properties: {
220+ faction_id: { type: "string", description: "Faction ID to join" },
221+ },
222+ required: ["faction_id"],
223+ },
224+ faction_invite: {
225+ properties: {
226+ player_id: { type: "string", description: "Player ID to invite" },
227+ },
228+ required: ["player_id"],
229+ },
230+ faction_kick: {
231+ properties: {
232+ player_id: { type: "string", description: "Player ID to kick" },
233+ },
234+ required: ["player_id"],
235+ },
236+ faction_promote: {
237+ properties: {
238+ player_id: { type: "string", description: "Player ID to promote" },
239+ role_id: { type: "string", description: "New role ID" },
240+ },
241+ required: ["player_id", "role_id"],
242+ },
243+ faction_info: {
244+ properties: {
245+ faction_id: { type: "string", description: "Faction ID (optional, defaults to your faction)" },
246+ },
247+ required: [],
248+ },
249+ faction_list: {
250+ properties: {
251+ limit: { type: "number", description: "Max results (default 50)" },
252+ offset: { type: "number", description: "Pagination offset" },
253+ },
254+ required: [],
255+ },
256+ faction_decline_invite: {
257+ properties: {
258+ faction_id: { type: "string", description: "Faction ID to decline" },
259+ },
260+ required: ["faction_id"],
261+ },
262+
263+ // Faction Diplomacy
264+ faction_set_ally: {
265+ properties: {
266+ target_faction_id: { type: "string", description: "Faction ID to ally with" },
267+ },
268+ required: ["target_faction_id"],
269+ },
270+ faction_set_enemy: {
271+ properties: {
272+ target_faction_id: { type: "string", description: "Faction ID to mark as enemy" },
273+ },
274+ required: ["target_faction_id"],
275+ },
276+ faction_declare_war: {
277+ properties: {
278+ target_faction_id: { type: "string", description: "Faction ID to declare war on" },
279+ reason: { type: "string", description: "Reason for war (optional)" },
280+ },
281+ required: ["target_faction_id"],
282+ },
283+ faction_propose_peace: {
284+ properties: {
285+ target_faction_id: { type: "string", description: "Faction ID to propose peace to" },
286+ terms: { type: "string", description: "Peace terms (optional)" },
287+ },
288+ required: ["target_faction_id"],
289+ },
290+ faction_accept_peace: {
291+ properties: {
292+ target_faction_id: { type: "string", description: "Faction ID to accept peace from" },
293+ },
294+ required: ["target_faction_id"],
295+ },
296+
297+ // Insurance
298+ buy_insurance: {
299+ properties: {
300+ coverage_percent: { type: "number", description: "Coverage percentage (50-100)" },
301+ },
302+ required: ["coverage_percent"],
303+ },
304+
305+ // Player Settings
306+ set_status: {
307+ properties: {
308+ status_message: { type: "string", description: "Status message" },
309+ clan_tag: { type: "string", description: "Clan tag (4 chars)" },
310+ },
311+ required: [],
312+ },
313+ set_colors: {
314+ properties: {
315+ primary_color: { type: "string", description: "Primary color (#RRGGBB)" },
316+ secondary_color: { type: "string", description: "Secondary color (#RRGGBB)" },
317+ },
318+ required: [],
319+ },
320+ set_anonymous: {
321+ properties: {
322+ anonymous: { type: "boolean", description: "Enable anonymous mode" },
323+ },
324+ required: ["anonymous"],
325+ },
326+
327+ // Information Queries
328+ get_system: {
329+ properties: {
330+ system_id: { type: "string", description: "System ID (optional, defaults to current)" },
331+ },
332+ required: [],
333+ },
334+ get_map: {
335+ properties: {
336+ system_id: { type: "string", description: "System ID for details (optional)" },
337+ },
338+ required: [],
339+ },
340+ help: {
341+ properties: {
342+ topic: { type: "string", description: "Command name to get help for" },
343+ },
344+ required: [],
345+ },
346+
347+ // Maps
348+ create_map: {
349+ properties: {
350+ name: { type: "string", description: "Map document name" },
351+ description: { type: "string", description: "Map description" },
352+ systems: { type: "array", description: "System IDs to include (empty = all)" },
353+ },
354+ required: ["name"],
355+ },
356+ use_map: {
357+ properties: {
358+ map_item_id: { type: "string", description: "Map item ID to use" },
359+ },
360+ required: ["map_item_id"],
361+ },
362+
363+ // Notes
364+ create_note: {
365+ properties: {
366+ title: { type: "string", description: "Note title (max 100 chars)" },
367+ content: { type: "string", description: "Note content (max 10000 chars)" },
368+ },
369+ required: ["title", "content"],
370+ },
371+ write_note: {
372+ properties: {
373+ note_id: { type: "string", description: "Note ID to edit" },
374+ content: { type: "string", description: "New content" },
375+ },
376+ required: ["note_id", "content"],
377+ },
378+ read_note: {
379+ properties: {
380+ note_id: { type: "string", description: "Note ID to read" },
381+ },
382+ required: ["note_id"],
383+ },
384+
385+ // Base Building
386+ build_base: {
387+ properties: {
388+ name: { type: "string", description: "Base name (max 32 chars)" },
389+ description: { type: "string", description: "Base description" },
390+ type: {
391+ type: "string",
392+ description: "Station type",
393+ enum: ["outpost", "station", "fortress"],
394+ },
395+ services: { type: "array", description: "Services to enable" },
396+ faction_base: { type: "boolean", description: "Build as faction base" },
397+ },
398+ required: ["name"],
399+ },
400+
401+ // Base Raiding
402+ attack_base: {
403+ properties: {
404+ base_id: { type: "string", description: "Base ID to attack" },
405+ },
406+ required: ["base_id"],
407+ },
408+ loot_base_wreck: {
409+ properties: {
410+ wreck_id: { type: "string", description: "Base wreck ID" },
411+ item_id: { type: "string", description: "Item ID to loot" },
412+ quantity: { type: "number", description: "Amount to loot" },
413+ credits: { type: "boolean", description: "Loot credits instead of items" },
414+ },
415+ required: ["wreck_id"],
416+ },
417+ salvage_base_wreck: {
418+ properties: {
419+ wreck_id: { type: "string", description: "Base wreck ID to salvage" },
420+ },
421+ required: ["wreck_id"],
422+ },
423+
424+ // Drones
425+ deploy_drone: {
426+ properties: {
427+ drone_item_id: {
428+ type: "string",
429+ description: "Drone type",
430+ enum: ["combat_drone", "mining_drone", "repair_drone"],
431+ },
432+ target_id: { type: "string", description: "Immediate attack target (combat only)" },
433+ },
434+ required: ["drone_item_id"],
435+ },
436+ recall_drone: {
437+ properties: {
438+ all: { type: "boolean", description: "Recall all drones" },
439+ drone_id: { type: "string", description: "Specific drone ID to recall" },
440+ },
441+ required: [],
442+ },
443+ order_drone: {
444+ properties: {
445+ command: {
446+ type: "string",
447+ description: "Drone command",
448+ enum: ["attack", "stop", "assist", "mine"],
449+ },
450+ target_id: { type: "string", description: "Target for attack/assist commands" },
451+ },
452+ required: ["command"],
453+ },
454+
455+ // Forum
456+ forum_list: {
457+ properties: {
458+ page: { type: "number", description: "Page number" },
459+ category: { type: "string", description: "Category filter" },
460+ },
461+ required: [],
462+ },
463+ forum_get_thread: {
464+ properties: {
465+ thread_id: { type: "string", description: "Thread ID" },
466+ },
467+ required: ["thread_id"],
468+ },
469+ forum_create_thread: {
470+ properties: {
471+ title: { type: "string", description: "Thread title" },
472+ content: { type: "string", description: "Thread content" },
473+ category: { type: "string", description: "Category" },
474+ },
475+ required: ["title", "content", "category"],
476+ },
477+ forum_reply: {
478+ properties: {
479+ thread_id: { type: "string", description: "Thread ID to reply to" },
480+ content: { type: "string", description: "Reply content" },
481+ },
482+ required: ["thread_id", "content"],
483+ },
484+ forum_upvote: {
485+ properties: {
486+ thread_id: { type: "string", description: "Thread ID to upvote" },
487+ reply_id: { type: "string", description: "Reply ID to upvote" },
488+ },
489+ required: [],
490+ },
491+ forum_delete_thread: {
492+ properties: {
493+ thread_id: { type: "string", description: "Thread ID to delete" },
494+ },
495+ required: ["thread_id"],
496+ },
497+ forum_delete_reply: {
498+ properties: {
499+ reply_id: { type: "string", description: "Reply ID to delete" },
500+ },
501+ required: ["reply_id"],
502+ },
503+
504+ // Captain's Log
505+ captains_log_add: {
506+ properties: {
507+ entry: { type: "string", description: "Log entry text (max 1KB)" },
508+ },
509+ required: ["entry"],
510+ },
511+ captains_log_get: {
512+ properties: {
513+ index: { type: "number", description: "Entry index (0 = newest)" },
514+ },
515+ required: ["index"],
516+ },
517+
518+ // Notifications (MCP only)
519+ get_notifications: {
520+ properties: {
521+ limit: { type: "number", description: "Max notifications (default 50)" },
522+ types: { type: "array", description: "Filter by types: chat, combat, trade, faction, friend, forum, system" },
523+ clear: { type: "boolean", description: "Clear notifications after reading (default true)" },
524+ },
525+ required: [],
526+ },
527+
528+ // Jettison
529+ jettison: {
530+ properties: {
531+ item_id: { type: "string", description: "Item ID to jettison" },
532+ quantity: { type: "number", description: "Amount to jettison" },
533+ },
534+ required: ["item_id", "quantity"],
535+ },
536+
537+ // Friends
538+ add_friend: {
539+ properties: {
540+ player_id: { type: "string", description: "Player ID to add as friend" },
541+ },
542+ required: ["player_id"],
543+ },
544+ remove_friend: {
545+ properties: {
546+ player_id: { type: "string", description: "Player ID to remove" },
547+ },
548+ required: ["player_id"],
549+ },
550+ accept_friend_request: {
551+ properties: {
552+ player_id: { type: "string", description: "Player ID to accept" },
553+ },
554+ required: ["player_id"],
555+ },
556+ decline_friend_request: {
557+ properties: {
558+ player_id: { type: "string", description: "Player ID to decline" },
559+ },
560+ required: ["player_id"],
561+ },
562+
563+ // Missions
564+ accept_mission: {
565+ properties: {
566+ mission_id: { type: "string", description: "Mission ID to accept" },
567+ },
568+ required: ["mission_id"],
569+ },
570+ complete_mission: {
571+ properties: {
572+ mission_id: { type: "string", description: "Mission ID to complete" },
573+ },
574+ required: ["mission_id"],
575+ },
576+ abandon_mission: {
577+ properties: {
578+ mission_id: { type: "string", description: "Mission ID to abandon" },
579+ },
580+ required: ["mission_id"],
581+ },
582+};