get_item_comments
Retrieve comments for a specific Qiita article to analyze discussions and user feedback. Provide the article ID to access all associated comments.
Instructions
指定された記事のコメント一覧を取得します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| itemId | Yes | 記事ID |
Implementation Reference
- src/tools/handlers.ts:165-168 (handler)Handler for the 'get_item_comments' tool. Parses arguments using itemIdSchema and delegates execution to the QiitaApiClient's getItemComments method.get_item_comments: { schema: itemIdSchema, execute: async ({ itemId }, client) => client.getItemComments(itemId), },
- src/tools/definitions.ts:507-519 (schema)MCP tool definition including name, description, and JSON schema for input validation of 'get_item_comments'.name: 'get_item_comments', description: '指定された記事のコメント一覧を取得します', inputSchema: { type: 'object', properties: { itemId: { type: 'string', description: '記事ID', }, }, required: ['itemId'], }, },
- src/qiitaApiClient.ts:206-209 (helper)Core implementation that performs the API request to retrieve comments for the specified item ID.async getItemComments(itemId: string) { const response = await this.client.get(`/items/${itemId}/comments`); return response.data; }
- src/index.ts:11-35 (registration)Imports toolHandlers and selects the handler by name during tool call request handling, effectively registering the 'get_item_comments' handler.import { toolHandlers } from './tools/handlers.js'; import { tools } from './tools/definitions.js'; const server = new Server( { name: 'mcp-server-qiita', version: '1.0.0', }, { capabilities: { tools: {}, }, } ); server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; }); server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; const accessToken = process.env.QIITA_ACCESS_TOKEN; const qiita = new QiitaApiClient(accessToken); const handler = toolHandlers[name];