esa_get_comment
Retrieve a specific comment by its ID from the esa API, optionally including related data such as stargazers, through the Model Context Protocol.
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:540-549 (handler)Executes the esa_get_comment tool: validates comment_id argument, calls esaClient.getComment(), serializes and returns the API 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:251-268 (schema)Input schema definition for esa_get_comment tool, specifying required comment_id (number) and optional include (string).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:607-618 (registration)Registers the esa_get_comment tool (getCommentTool) in the array returned by the ListToolsRequest handler.tools: [ listPostsTool, getPostTool, createPostTool, updatePostTool, listCommentsTool, getCommentTool, createCommentTool, getMembersTool, getMemberTool, ], };
- index.ts:401-410 (helper)EsaClient.getComment helper method: constructs ESA API URL for /comments/{comment_id}, optionally adds include param, 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:55-58 (schema)TypeScript interface defining input arguments for esa_get_comment tool.interface GetCommentArgs { comment_id: number; include?: string; }