Skip to main content
Glama
GodisinHisHeaven

USCardForum MCP Server

search_forum

Search USCardForum for credit card and points discussions using advanced query operators to filter by title, author, category, tag, date, or sort results.

Instructions

Search USCardForum for topics and posts matching a query.

Args:
    query: Search query string. Supports Discourse operators:
        - Basic: "chase sapphire bonus"
        - In title only: "chase sapphire in:title"
        - By author: "@username chase"
        - In category: "category:credit-cards chase"
        - With tag: "#amex bonus"
        - Exact phrase: '"sign up bonus"'
        - Exclude: "chase -sapphire"
        - Time: "after:2024-01-01" or "before:2024-06-01"

    page: Page number for pagination (starts at 1)

    order: Sort order for results. Options:
        - "relevance": Best match (default)
        - "latest": Most recent first
        - "views": Most viewed
        - "likes": Most liked
        - "activity": Recent activity
        - "posts": Most replies

Returns a SearchResult object with:
- posts: List of matching SearchPost objects with excerpts
- topics: List of matching SearchTopic objects
- users: List of matching SearchUser objects
- grouped_search_result: Metadata about result counts

Example queries:
- "Chase Sapphire Reserve order:latest" - Recent CSR discussions
- "AMEX popup in:title" - Topics about AMEX popup in title
- "data point category:credit-cards" - Data points in CC category
- "@expert_user order:likes" - Most liked posts by a user

Pagination: If more results exist, increment page parameter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query string. Supports operators: 'in:title', '@username', 'category:name', '#tag', 'after:date', 'before:date'
pageNoPage number for pagination (starts at 1)
orderNoSort order: 'relevance' (default), 'latest', 'views', 'likes', 'activity', or 'posts'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
postsNoMatching posts
usersNoMatching users
topicsNoMatching topics
grouped_search_resultNoResult metadata

Implementation Reference

  • The primary handler for the 'search_forum' tool. Uses @mcp.tool() decorator for registration. Input schema defined inline with Pydantic Field descriptions. Logic delegates search to the DiscourseClient instance.
    @mcp.tool()
    def search_forum(
        query: Annotated[
            str,
            Field(
                description="Search query string. Supports operators: 'in:title', '@username', 'category:name', '#tag', 'after:date', 'before:date'"
            ),
        ],
        page: Annotated[
            int | None,
            Field(default=None, description="Page number for pagination (starts at 1)"),
        ] = None,
        order: Annotated[
            str | None,
            Field(
                default=None,
                description="Sort order: 'relevance' (default), 'latest', 'views', 'likes', 'activity', or 'posts'",
            ),
        ] = None,
    ) -> SearchResult:
        """
        Search USCardForum for topics and posts matching a query.
    
        Args:
            query: Search query string. Supports Discourse operators:
                - Basic: "chase sapphire bonus"
                - In title only: "chase sapphire in:title"
                - By author: "@username chase"
                - In category: "category:credit-cards chase"
                - With tag: "#amex bonus"
                - Exact phrase: '"sign up bonus"'
                - Exclude: "chase -sapphire"
                - Time: "after:2024-01-01" or "before:2024-06-01"
    
            page: Page number for pagination (starts at 1)
    
            order: Sort order for results. Options:
                - "relevance": Best match (default)
                - "latest": Most recent first
                - "views": Most viewed
                - "likes": Most liked
                - "activity": Recent activity
                - "posts": Most replies
    
        Returns a SearchResult object with:
        - posts: List of matching SearchPost objects with excerpts
        - topics: List of matching SearchTopic objects
        - users: List of matching SearchUser objects
        - grouped_search_result: Metadata about result counts
    
        Example queries:
        - "Chase Sapphire Reserve order:latest" - Recent CSR discussions
        - "AMEX popup in:title" - Topics about AMEX popup in title
        - "data point category:credit-cards" - Data points in CC category
        - "@expert_user order:likes" - Most liked posts by a user
    
        Pagination: If more results exist, increment page parameter.
        """
        return get_client().search(query, page=page, order=order)
  • Pydantic model defining the structured output schema for search results, including nested models for posts, topics, users, and grouped results. Provides from_api_response factory for parsing raw API data.
    class SearchResult(BaseModel):
        """Complete search results."""
    
        posts: list[SearchPost] = Field(default_factory=list, description="Matching posts")
        topics: list[SearchTopic] = Field(
            default_factory=list, description="Matching topics"
        )
        users: list[SearchUser] = Field(default_factory=list, description="Matching users")
        grouped_search_result: GroupedSearchResult | None = Field(
            None, description="Result metadata"
        )
    
        class Config:
            extra = "ignore"
    
        @classmethod
        def from_api_response(cls, data: dict[str, Any]) -> "SearchResult":
            """Parse from raw API response."""
            posts = [SearchPost(**p) for p in data.get("posts", [])]
            topics = [SearchTopic(**t) for t in data.get("topics", [])]
            users = [SearchUser(**u) for u in data.get("users", [])]
    
            grouped = None
            if "grouped_search_result" in data:
                grouped = GroupedSearchResult(**data["grouped_search_result"])
    
            return cls(
                posts=posts,
                topics=topics,
                users=users,
                grouped_search_result=grouped,
            )
  • Imports all MCP tools including 'search_forum' from server_tools package. Importing triggers the automatic registration via decorators when the server module is loaded.
    from uscardforum.server_tools import (
        analyze_user,
        bookmark_post,
        compare_cards,
        find_data_points,
        get_all_topic_posts,
        get_categories,
        get_current_session,
        get_hot_topics,
        get_new_topics,
        get_notifications,
        get_top_topics,
        get_topic_info,
        get_topic_posts,
        get_user_actions,
        get_user_badges,
        get_user_followers,
        get_user_following,
        get_user_reactions,
        get_user_replies,
        get_user_summary,
        get_user_topics,
        list_users_with_badge,
        login,
        research_topic,
        resource_categories,
        resource_hot_topics,
        resource_new_topics,
        search_forum,
        subscribe_topic,
    )
Behavior5/5

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

With no annotations provided, the description carries the full burden and excels by disclosing key behavioral traits: it explains pagination behavior ('If more results exist, increment page parameter'), details the return format (SearchResult object with nested lists and metadata), and mentions default values (e.g., order defaults to 'relevance'). This goes beyond basic functionality to guide usage effectively.

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

Conciseness5/5

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

The description is well-structured and front-loaded, starting with the core purpose, followed by organized sections for args, returns, examples, and pagination. Every sentence earns its place by providing essential information without redundancy, making it efficient and easy to parse.

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

Completeness5/5

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

Given the tool's complexity (3 parameters, no annotations, but with an output schema), the description is complete: it covers purpose, usage, parameters, returns, examples, and behavioral details like pagination. The output schema handles return values, so the description appropriately focuses on operational guidance without redundancy.

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

Parameters5/5

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

Despite 100% schema description coverage, the description adds significant value by elaborating on parameter semantics: it provides detailed examples of query operators (e.g., 'in:title', '@username'), explains page numbering ('starts at 1'), and lists all order options with clarifications like 'relevance' as default. This enhances understanding beyond the schema's brief descriptions.

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

Purpose5/5

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

The description clearly states the tool searches USCardForum for topics and posts matching a query, using specific verbs ('search') and resources ('topics and posts'). It distinguishes from siblings like get_top_topics or get_new_topics by emphasizing query-based matching rather than retrieving predefined lists.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool (searching with queries) and includes example queries that illustrate use cases. However, it does not explicitly state when not to use it or name specific alternatives among siblings, such as get_hot_topics for trending content without queries.

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/GodisinHisHeaven/uscardforum-mcp'

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