create_comment
Post comments on Qiita articles using the item ID and Markdown-formatted text to engage with the developer community.
Instructions
指定された記事にコメントを作成します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | コメントの本文(Markdown形式) | |
| itemId | Yes | 記事ID |
Implementation Reference
- src/tools/handlers.ts:169-175 (handler)The handler definition for the 'create_comment' tool, including input validation schema and the execute function that delegates to the QiitaApiClient's createComment method.create_comment: { schema: z.object({ itemId: z.string(), body: z.string(), }), execute: async ({ itemId, body }, client) => client.createComment(itemId, body), },
- src/tools/definitions.ts:520-537 (schema)The MCP tool definition for 'create_comment', including name, description, and input schema for validation.{ name: 'create_comment', description: '指定された記事にコメントを作成します', inputSchema: { type: 'object', properties: { itemId: { type: 'string', description: '記事ID', }, body: { type: 'string', description: 'コメントの本文(Markdown形式)', }, }, required: ['itemId', 'body'], }, },
- src/qiitaApiClient.ts:211-215 (helper)The supporting method in QiitaApiClient that performs the actual API call to create a comment on a Qiita item.async createComment(itemId: string, body: string) { this.assertAuthenticated(); const response = await this.client.post(`/items/${itemId}/comments`, { body }); return response.data; }