From 353e62a40177ddd0646515e69cbe2f5d5e758f36 Mon Sep 17 00:00:00 2001 From: Nicholas Crum Date: Tue, 13 May 2025 16:52:17 -0600 Subject: [PATCH] refactor: rename add_merge_request_thread_note to create_merge_request_note for consistency --- README.md | 2 +- index.ts | 14 +++++++------- schemas.ts | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 68fb3f5..b58051c 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ When using with the Claude App, you need to set up your API key and URLs directl 14. `create_merge_request_thread` - Create a new thread on a merge request 15. `mr_discussions` - List discussion items for a merge request 16. `update_merge_request_note` - Modify an existing merge request thread note -17. `add_merge_request_thread_note` - Add a new note to an existing merge request thread +17. `create_merge_request_note` - Add a new note to an existing merge request thread 18. `list_issues` - List issues in a GitLab project with filtering options 19. `get_issue` - Get details of a specific issue in a GitLab project 20. `update_issue` - Update an issue in a GitLab project diff --git a/index.ts b/index.ts index f7d8b74..422d96f 100644 --- a/index.ts +++ b/index.ts @@ -87,7 +87,7 @@ import { GitLabDiscussionNoteSchema, // Added GitLabDiscussionSchema, UpdateMergeRequestNoteSchema, // Added - AddMergeRequestThreadNoteSchema, // Added + CreateMergeRequestNoteSchema, // Added ListMergeRequestDiscussionsSchema, type GitLabFork, type GitLabReference, @@ -282,9 +282,9 @@ const allTools = [ inputSchema: zodToJsonSchema(UpdateMergeRequestNoteSchema), }, { - name: "add_merge_request_thread_note", + name: "create_merge_request_note", description: "Add a new note to an existing merge request thread", - inputSchema: zodToJsonSchema(AddMergeRequestThreadNoteSchema), + inputSchema: zodToJsonSchema(CreateMergeRequestNoteSchema), }, { name: "list_issues", @@ -1077,7 +1077,7 @@ async function updateMergeRequestNote( * @param {string} [createdAt] - The creation date of the note (ISO 8601 format) * @returns {Promise} The created note */ -async function addMergeRequestThreadNote( +async function createMergeRequestNote( projectId: string, mergeRequestIid: number, discussionId: string, @@ -2385,11 +2385,11 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { }; } - case "add_merge_request_thread_note": { - const args = AddMergeRequestThreadNoteSchema.parse( + case "create_merge_request_note": { + const args = CreateMergeRequestNoteSchema.parse( request.params.arguments ); - const note = await addMergeRequestThreadNote( + const note = await createMergeRequestNote( args.project_id, args.merge_request_iid, args.discussion_id, diff --git a/schemas.ts b/schemas.ts index d779592..a6857b3 100644 --- a/schemas.ts +++ b/schemas.ts @@ -480,7 +480,7 @@ export const UpdateMergeRequestNoteSchema = ProjectParamsSchema.extend({ }); // Input schema for adding a note to an existing merge request discussion -export const AddMergeRequestThreadNoteSchema = ProjectParamsSchema.extend({ +export const CreateMergeRequestNoteSchema = ProjectParamsSchema.extend({ merge_request_iid: z.number().describe("The IID of a merge request"), discussion_id: z.string().describe("The ID of a thread"), body: z.string().describe("The content of the note or reply"), @@ -1087,4 +1087,4 @@ export type GitLabTreeItem = z.infer; export type GetRepositoryTreeOptions = z.infer; export type MergeRequestThreadPosition = z.infer; export type CreateMergeRequestThreadOptions = z.infer; -export type AddMergeRequestThreadNoteOptions = z.infer; +export type CreateMergeRequestNoteOptions = z.infer;