update_comment
Modify existing comments on Qiita articles by providing a comment ID and updated Markdown content to edit or correct previous contributions.
Instructions
指定されたコメントを更新します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commentId | Yes | コメントID | |
| body | Yes | コメントの本文(Markdown形式) |
Implementation Reference
- src/tools/handlers.ts:176-182 (handler)The handler definition for the 'update_comment' MCP tool. It includes Zod schema for input validation (commentId and body) and an execute function that delegates to the QiitaApiClient's updateComment method.update_comment: { schema: z.object({ commentId: z.string(), body: z.string(), }), execute: async ({ commentId, body }, client) => client.updateComment(commentId, body), },
- src/tools/definitions.ts:538-555 (schema)The MCP tool definition for 'update_comment', including name, description, and inputSchema for listing in tool discovery.{ name: 'update_comment', description: '指定されたコメントを更新します', inputSchema: { type: 'object', properties: { commentId: { type: 'string', description: 'コメントID', }, body: { type: 'string', description: 'コメントの本文(Markdown形式)', }, }, required: ['commentId', 'body'], }, },
- src/qiitaApiClient.ts:217-221 (helper)The QiitaApiClient method that implements the core logic: authenticates, makes a PATCH request to Qiita API endpoint /comments/{commentId} with the new body, and returns the response.async updateComment(commentId: string, body: string) { this.assertAuthenticated(); const response = await this.client.patch(`/comments/${commentId}`, { body }); return response.data; }