Skip to main content
Glama
rhettlong

USCardForum MCP Server

by rhettlong

get_categories

Retrieve all forum categories to filter content, navigate sections, and identify topic areas in the USCardForum community.

Instructions

Get a mapping of all forum categories.

Returns a CategoryMap object with category_id to category name mapping.
Categories organize topics by subject area.

Common USCardForum categories include sections for:
- Credit card applications and approvals
- Bank account bonuses
- Travel and redemptions
- Data points and experiences

Use category IDs to:
- Filter search results by category
- Understand which section a topic belongs to
- Navigate to specific areas of interest

The mapping includes both main categories and subcategories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoriesNoID to name mapping

Implementation Reference

  • The MCP tool handler for 'get_categories'. Decorated with @mcp.tool(), it fetches the CategoryMap from the DiscourseClient and returns it as the tool output.
    @mcp.tool()
    def get_categories() -> CategoryMap:
        """
        Get a mapping of all forum categories.
    
        Returns a CategoryMap object with category_id to category name mapping.
        Categories organize topics by subject area.
    
        Common USCardForum categories include sections for:
        - Credit card applications and approvals
        - Bank account bonuses
        - Travel and redemptions
        - Data points and experiences
    
        Use category IDs to:
        - Filter search results by category
        - Understand which section a topic belongs to
        - Navigate to specific areas of interest
    
        The mapping includes both main categories and subcategories.
        """
        return get_client().get_category_map()
  • Pydantic BaseModel defining the output schema of the get_categories tool: a dictionary mapping category IDs to names.
    class CategoryMap(BaseModel):
        """Mapping of category IDs to names."""
    
        categories: dict[int, str] = Field(
            default_factory=dict, description="ID to name mapping"
        )
    
        def get_name(self, category_id: int) -> str | None:
            """Get category name by ID."""
            return self.categories.get(category_id)
    
        def __getitem__(self, category_id: int) -> str:
            """Get category name by ID."""
            return self.categories[category_id]
    
        def __contains__(self, category_id: int) -> bool:
            """Check if category ID exists."""
            return category_id in self.categories
    
        def items(self):
            """Iterate over category mappings."""
            return self.categories.items()
  • Multi-line import statement from server_tools that includes get_categories, registering it as an MCP tool in the FastMCP server entrypoint.
    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,
    )
  • Helper function in CategoriesAPI that builds the CategoryMap from API response, called indirectly via client.get_category_map() from the tool handler.
    def get_category_map(self, use_cache: bool = True) -> CategoryMap:
        """Get mapping of category IDs to names.
    
        Args:
            use_cache: Use cached map if available (default: True)
    
        Returns:
            CategoryMap with ID to name mapping
        """
        if use_cache and self._category_cache is not None:
            return CategoryMap(categories=self._category_cache)
    
        categories = self.get_categories()
        mapping = {cat.id: cat.name for cat in categories}
        self._category_cache = mapping
        return CategoryMap(categories=mapping)
  • Client wrapper method get_category_map() that delegates to CategoriesAPI, called by get_client().get_category_map() in the tool handler.
    def get_category_map(self) -> CategoryMap:
        """Get mapping of category IDs to names.
    
        Returns:
            CategoryMap with ID to name mapping
        """
        return self._categories.get_category_map()
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by specifying the return type ('CategoryMap object'), scope ('all forum categories'), structure ('includes both main categories and subcategories'), and provides concrete examples of common categories. It doesn't mention rate limits, authentication needs, or pagination behavior, but covers the essential operational context.

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 with the core purpose in the first sentence. Each subsequent paragraph adds value: output format, category purpose, concrete examples, usage scenarios, and scope clarification. No wasted sentences or redundant information.

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 simplicity (0 parameters, has output schema), the description is complete. It explains what the tool does, what it returns, why categories matter, provides examples, and outlines usage scenarios. The output schema will handle return value details, so the description appropriately focuses on higher-level context.

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?

With 0 parameters and 100% schema description coverage, the baseline would be 4. The description appropriately doesn't discuss parameters since none exist, and instead focuses on the tool's purpose and output. No parameter information is needed or expected.

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 specific action ('Get a mapping'), resource ('all forum categories'), and output format ('CategoryMap object with category_id to category name mapping'). It distinguishes this tool from siblings like get_hot_topics or get_new_topics by focusing on category metadata rather than topic content.

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 ('Use category IDs to filter search results, understand topic sections, navigate to areas of interest'), but doesn't explicitly state when NOT to use it or name specific alternatives among sibling tools. The guidance is practical but lacks explicit exclusions.

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

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