Skip to main content
Glama
jaipandya

product-hunt-mcp

by jaipandya

get_topic

Retrieve detailed information about a specific Product Hunt topic using its ID or slug, including name, description, follower count, and related posts.

Instructions

    Retrieve detailed information about a specific topic by ID or slug.

    Parameters:
    - id (str, optional): The topic's unique ID.
    - slug (str, optional): The topic's slug (e.g., "artificial-intelligence").

    At least one of `id` or `slug` must be provided.

    Returns:
    - success (bool)
    - data (dict): If successful, contains topic details:
        - id, name, description, follower_count, posts, etc.
    - error (dict, optional)
    - rate_limits (dict)

    Notes:
    - Returns an error if neither `id` nor `slug` is provided, or if the topic is not found.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNo
slugNo

Implementation Reference

  • The handler function that executes the get_topic tool logic, decorated with @mcp.tool(), @require_token, @handle_errors, and @validate_with_schema. It fetches topic details using a GraphQL query.
    def get_topic(id: str = None, slug: str = None) -> Dict[str, Any]:
        """
        Retrieve detailed information about a specific topic by ID or slug.
    
        Parameters:
        - id (str, optional): The topic's unique ID.
        - slug (str, optional): The topic's slug (e.g., "artificial-intelligence").
    
        At least one of `id` or `slug` must be provided.
    
        Returns:
        - success (bool)
        - data (dict): If successful, contains topic details:
            - id, name, description, follower_count, posts, etc.
        - error (dict, optional)
        - rate_limits (dict)
    
        Notes:
        - Returns an error if neither `id` nor `slug` is provided, or if the topic is not found.
        """
        params = {k: v for k, v in {"id": id, "slug": slug}.items() if v is not None}
        logger.info("topics.get_topic called", extra=params)
    
        variables = {}
        add_id_or_slug(variables, id, slug)
    
        # Execute the query and check if topic exists
        id_or_slug = id or slug
        topic_data, rate_limits, error = execute_and_check_query(
            TOPIC_QUERY, variables, "topic", id_or_slug
        )
    
        if error:
            return format_response(False, error=error, rate_limits=rate_limits)
    
        return format_response(True, data=topic_data, rate_limits=rate_limits)
  • Input validation schema for the get_topic tool, requiring at least one of 'id' or 'slug' as string.
    TOPIC_SCHEMA = {"requires_one_of": [["id", "slug"]], "id": {"type": str}, "slug": {"type": str}}
  • Invocation of register_topic_tools(mcp) which registers the get_topic tool via @mcp.tool() decorator inside it.
    register_topic_tools(mcp)
  • The @mcp.tool() decorator that registers the get_topic function as an MCP tool.
    @mcp.tool()
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it's a read operation (implied by 'retrieve'), specifies error conditions ('Returns an error if neither `id` nor `slug` is provided, or if the topic is not found'), and mentions rate limits in the return structure. However, it doesn't detail authentication needs or potential side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, parameters, returns, notes) and uses bullet points for readability. It's appropriately sized for the tool's complexity, though the return details could be more concise as they're not strictly necessary without an output schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no annotations, no output schema), the description is fairly complete. It covers purpose, parameters, returns, and error conditions. However, it lacks explicit guidance on when to use versus siblings and doesn't detail authentication or rate limit specifics beyond mentioning them in returns.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It clearly explains both parameters: 'id' as the topic's unique ID and 'slug' as the topic's slug with an example. It also specifies the constraint that at least one must be provided. This adds substantial meaning beyond the bare schema, though it could elaborate on format expectations.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Retrieve detailed information about a specific topic by ID or slug.' This specifies the verb (retrieve), resource (topic), and method (by ID or slug). However, it doesn't explicitly differentiate from sibling tools like 'get_user' or 'get_post_details' beyond the resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides basic usage context: 'At least one of `id` or `slug` must be provided' and mentions error conditions. However, it doesn't explicitly guide when to use this tool versus alternatives like 'search_topics' or 'get_collection', nor does it specify prerequisites or exclusions beyond the parameter requirement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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