@zereight/mcp-gitlab 2.3.28-next.241 → 2.3.28-next.243

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.
@@ -163,3 +163,45 @@ export const toJSONSchema = (schema) => {
163
163
  zodSchemaByJsonSchema.set(fixedSchema, schema);
164
164
  return fixedSchema;
165
165
  };
166
+ // lazyJSONSchema() placeholder -> the Zod schema to convert on first read.
167
+ const zodSchemaByPlaceholder = new WeakMap();
168
+ /**
169
+ * Placeholder for toJSONSchema(schema) in a tool list passed to withLazyInputSchemas().
170
+ * Only valid as a tool's inputSchema there; it has no JSON Schema keys of its own.
171
+ */
172
+ export const lazyJSONSchema = (schema) => {
173
+ const placeholder = {};
174
+ zodSchemaByPlaceholder.set(placeholder, schema);
175
+ return placeholder;
176
+ };
177
+ /**
178
+ * Replaces each lazyJSONSchema() inputSchema with a getter that runs toJSONSchema()
179
+ * on first read and then stores the result as a plain data property. A default
180
+ * tools/list shows a small part of the registry, so most schemas are never built.
181
+ */
182
+ export const withLazyInputSchemas = (tools) => {
183
+ for (const tool of tools) {
184
+ const placeholder = tool.inputSchema;
185
+ const schema = typeof placeholder === "object" && placeholder !== null
186
+ ? zodSchemaByPlaceholder.get(placeholder)
187
+ : undefined;
188
+ if (schema === undefined) {
189
+ continue;
190
+ }
191
+ Object.defineProperty(tool, "inputSchema", {
192
+ configurable: true,
193
+ enumerable: true,
194
+ get() {
195
+ const inputSchema = toJSONSchema(schema);
196
+ Object.defineProperty(tool, "inputSchema", {
197
+ configurable: true,
198
+ enumerable: true,
199
+ writable: true,
200
+ value: inputSchema,
201
+ });
202
+ return inputSchema;
203
+ },
204
+ });
205
+ }
206
+ return tools;
207
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zereight/mcp-gitlab",
3
- "version": "2.3.28-next.241",
3
+ "version": "2.3.28-next.243",
4
4
  "mcpName": "io.github.zereight/gitlab-mcp",
5
5
  "description": "GitLab MCP server for projects, merge requests, issues, pipelines, wiki, releases, and more",
6
6
  "keywords": [