@zereight/mcp-gitlab 2.3.28-next.242 → 2.3.28-next.244
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/README.ko.md +5 -5
- package/README.md +6 -6
- package/README.pt-BR.md +5 -5
- package/README.zh-CN.md +5 -5
- package/build/index.js +2 -2
- package/build/schemas.js +1 -1
- package/build/tools/registry.js +295 -295
- package/build/tools/tool-descriptions.js +2 -0
- package/build/utils/schema.js +42 -0
- package/package.json +1 -1
|
@@ -6,6 +6,8 @@ const TOOL_GUIDANCE = {
|
|
|
6
6
|
get_merge_request_approval_state: "Inspect approval rules and approvers before merging. Use `approve_merge_request` to change approval state.",
|
|
7
7
|
get_merge_request_conflicts: "Inspect merge conflicts before `merge_merge_request`. It reports conflicts and does not resolve them.",
|
|
8
8
|
list_merge_request_pipelines: "List pipelines for one merge request. Use `list_pipelines` for project-wide filtering.",
|
|
9
|
+
get_file_contents: "`ref` defaults to the default branch. `encoding` is `utf8` when a UTF-8 round-trip test passes, else `base64`; binaries with valid UTF-8 bytes (e.g. 0x00) also pass. Read `encoding`, don't infer it. Directories are not supported: use `get_repository_tree`.",
|
|
10
|
+
get_repository_tree: "One level under `path` unless `recursive` is true. Use `get_file_contents` to read a file.",
|
|
9
11
|
create_or_update_file: "Create or update one repository file. Use `push_files` for a multi-file commit. Optional `encoding` (`text` or `base64`) defaults to `GITLAB_REPO_FILE_ENCODING`.",
|
|
10
12
|
push_files: "Commit several file changes atomically. Each file defaults to action `create`; optional per-file `action` (create/update/delete/move) and `encoding` (text/base64) are additive. `GITLAB_PERMISSION_MODE=modify` rejects `delete` and `move`.",
|
|
11
13
|
create_issue: "Open a new issue. Use `update_issue` for an existing issue and `create_issue_note` for discussion.",
|
package/build/utils/schema.js
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "2.3.28-next.244",
|
|
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": [
|