Skip to main content
Glama
hmumixaM

USCardForum MCP Server

by hmumixaM

get_categories

Retrieve a complete mapping of forum categories to filter content, navigate sections, and organize topics by subject area 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

Implementation Reference

  • The @mcp.tool()-decorated handler function that implements the get_categories tool logic, fetching and returning the CategoryMap.
    @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 type CategoryMap returned by the get_categories tool.
    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()
  • Import statement that brings the get_categories tool into the server_tools package namespace for registration.
    from .categories import get_categories
  • Explicit import of get_categories in the main server.py file, ensuring the decorated tool is registered with the MCP server.
    get_categories,

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/hmumixaM/uscardforum-mcp4'

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