Skip to main content
Glama
jaipandya

product-hunt-mcp

by jaipandya

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
NameRequiredDescriptionDefault
idNo

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}}
  • Invocation of register_comment_tools which defines and registers the get_comment tool with the MCP server.
    register_comment_tools(mcp)
  • The @mcp.tool() decorator that registers the get_comment function as an MCP tool.
    @mcp.tool()

Other Tools

Related Tools

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/jaipandya/producthunt-mcp-server'

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