@akiojin/unity-mcp-server 2.37.1 → 2.37.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akiojin/unity-mcp-server",
3
- "version": "2.37.1",
3
+ "version": "2.37.2",
4
4
  "description": "MCP server and Unity Editor bridge — enables AI assistants to control Unity for AI-assisted workflows",
5
5
  "type": "module",
6
6
  "main": "src/core/server.js",
@@ -123,15 +123,24 @@ export class InputGamepadToolHandler extends BaseToolHandler {
123
123
  required: ['action']
124
124
  }
125
125
  }
126
- },
127
- anyOf: [{ required: ['action'] }, { required: ['actions'] }]
126
+ }
128
127
  }
129
128
  );
130
129
  this.unityConnection = unityConnection;
131
130
  }
132
131
 
133
132
  validate(params) {
134
- const { actions } = params;
133
+ const { action, actions } = params;
134
+
135
+ // Either 'action' or 'actions' must be provided
136
+ if (!action && !actions) {
137
+ throw new Error('Either "action" or "actions" parameter is required');
138
+ }
139
+
140
+ // But not both
141
+ if (action && actions) {
142
+ throw new Error('Cannot specify both "action" and "actions" parameters');
143
+ }
135
144
 
136
145
  if (Array.isArray(actions)) {
137
146
  if (actions.length === 0) {
@@ -88,15 +88,24 @@ export class InputKeyboardToolHandler extends BaseToolHandler {
88
88
  required: ['action']
89
89
  }
90
90
  }
91
- },
92
- anyOf: [{ required: ['action'] }, { required: ['actions'] }]
91
+ }
93
92
  }
94
93
  );
95
94
  this.unityConnection = unityConnection;
96
95
  }
97
96
 
98
97
  validate(params) {
99
- const { actions } = params;
98
+ const { action, actions } = params;
99
+
100
+ // Either 'action' or 'actions' must be provided
101
+ if (!action && !actions) {
102
+ throw new Error('Either "action" or "actions" parameter is required');
103
+ }
104
+
105
+ // But not both
106
+ if (action && actions) {
107
+ throw new Error('Cannot specify both "action" and "actions" parameters');
108
+ }
100
109
 
101
110
  if (Array.isArray(actions)) {
102
111
  if (actions.length === 0) {
@@ -149,15 +149,24 @@ export class InputMouseToolHandler extends BaseToolHandler {
149
149
  required: ['action']
150
150
  }
151
151
  }
152
- },
153
- anyOf: [{ required: ['action'] }, { required: ['actions'] }]
152
+ }
154
153
  }
155
154
  );
156
155
  this.unityConnection = unityConnection;
157
156
  }
158
157
 
159
158
  validate(params) {
160
- const { actions } = params;
159
+ const { action, actions } = params;
160
+
161
+ // Either 'action' or 'actions' must be provided
162
+ if (!action && !actions) {
163
+ throw new Error('Either "action" or "actions" parameter is required');
164
+ }
165
+
166
+ // But not both
167
+ if (action && actions) {
168
+ throw new Error('Cannot specify both "action" and "actions" parameters');
169
+ }
161
170
 
162
171
  if (Array.isArray(actions)) {
163
172
  if (actions.length === 0) {
@@ -140,14 +140,23 @@ export class InputTouchToolHandler extends BaseToolHandler {
140
140
  required: ['action']
141
141
  }
142
142
  }
143
- },
144
- anyOf: [{ required: ['action'] }, { required: ['actions'] }]
143
+ }
145
144
  });
146
145
  this.unityConnection = unityConnection;
147
146
  }
148
147
 
149
148
  validate(params) {
150
- const { actions } = params;
149
+ const { action, actions } = params;
150
+
151
+ // Either 'action' or 'actions' must be provided
152
+ if (!action && !actions) {
153
+ throw new Error('Either "action" or "actions" parameter is required');
154
+ }
155
+
156
+ // But not both
157
+ if (action && actions) {
158
+ throw new Error('Cannot specify both "action" and "actions" parameters');
159
+ }
151
160
 
152
161
  if (Array.isArray(actions)) {
153
162
  if (actions.length === 0) {