get_comment
Retrieve detailed information about a specific comment by ID, including content, creation timestamp, user, and post details, using the product-hunt-mcp server.
Instructions
Retrieve detailed information about a specific comment by ID.
Parameters:
- id (str, required): The comment's unique ID.
Returns:
- success (bool)
- data (dict): If successful, contains comment details:
- id, content, created_at, user, post, etc.
- error (dict, optional)
- rate_limits (dict)
Notes:
- Returns an error if the comment is not found.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No |
Implementation Reference
- Handler function for the 'get_comment' tool. Retrieves a specific comment by ID using GraphQL query, handles errors, and formats response.@mcp.tool() @require_token @handle_errors @validate_with_schema(COMMENT_SCHEMA) def get_comment(id: str = None) -> Dict[str, Any]: """ Retrieve detailed information about a specific comment by ID. Parameters: - id (str, required): The comment's unique ID. Returns: - success (bool) - data (dict): If successful, contains comment details: - id, content, created_at, user, post, etc. - error (dict, optional) - rate_limits (dict) Notes: - Returns an error if the comment is not found. """ params = {k: v for k, v in {"id": id}.items() if v is not None} logger.info("comments.get_comment called", extra=params) comment_data, rate_limits, error = execute_and_check_query( COMMENT_QUERY, {"id": id}, "comment", id ) if error: return format_response(False, error=error, rate_limits=rate_limits) return format_response(True, data=comment_data, rate_limits=rate_limits)
- Input validation schema for the get_comment tool, requiring a string 'id' parameter.COMMENT_SCHEMA = {"id": {"required": True, "type": str}}
- src/product_hunt_mcp/cli.py:36-36 (registration)Invocation of register_comment_tools which defines and registers the get_comment tool with the MCP server.register_comment_tools(mcp)
- src/product_hunt_mcp/tools/comments.py:27-27 (registration)The @mcp.tool() decorator that registers the get_comment function as an MCP tool.@mcp.tool()