esa_get_comment
Retrieve a specific comment from esa using its ID to view details and related data like stargazers.
Instructions
Get a specific comment
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comment_id | Yes | ID of the comment to retrieve | |
| include | No | レスポンスに含める関連データ (例: 'stargazers') |
Implementation Reference
- index.ts:251-268 (schema)Tool schema definition for 'esa_get_comment', including name, description, and input schema with required 'comment_id'.const getCommentTool: Tool = { name: "esa_get_comment", description: "Get a specific comment", inputSchema: { type: "object", properties: { comment_id: { type: "number", description: "ID of the comment to retrieve", }, include: { type: "string", description: "レスポンスに含める関連データ (例: 'stargazers')", }, }, required: ["comment_id"], }, };
- index.ts:540-549 (handler)Handler logic in the CallToolRequest switch statement: validates args, calls esaClient.getComment, and returns JSON response.case "esa_get_comment": { const args = request.params.arguments as unknown as GetCommentArgs; if (!args.comment_id) { throw new Error("comment_id is required"); } const response = await esaClient.getComment(args.comment_id, args.include); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- index.ts:401-410 (helper)EsaClient.getComment method: constructs API URL for /comments/{comment_id}, appends include param if provided, fetches and returns JSON.async getComment(comment_id: number, include?: string): Promise<any> { const params = new URLSearchParams(); if (include) params.append("include", include); const url = `${this.baseUrl}/comments/${comment_id}${params.toString() ? `?${params}` : ""}`; const response = await fetch(url, { headers: this.headers }); return response.json(); }
- index.ts:607-617 (registration)Registration of 'esa_get_comment' tool (as getCommentTool) in the tools list returned by ListToolsRequest handler.tools: [ listPostsTool, getPostTool, createPostTool, updatePostTool, listCommentsTool, getCommentTool, createCommentTool, getMembersTool, getMemberTool, ],
- index.ts:55-58 (schema)TypeScript interface defining arguments for esa_get_comment tool.interface GetCommentArgs { comment_id: number; include?: string; }