Skip to main content
Glama

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
NameRequiredDescriptionDefault
comment_idYesID of the comment to retrieve
includeNoレスポンスに含める関連データ (例: 'stargazers')

Implementation Reference

  • 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"],
      },
    };
  • 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) }],
      };
    }
  • 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,
    ],
  • TypeScript interface defining arguments for esa_get_comment tool.
    interface GetCommentArgs {
      comment_id: number;
      include?: string;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kajirita2002/esa-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server