Skip to main content
Glama
rhettlong

USCardForum MCP Server

by rhettlong

subscribe_topic

Set notification preferences for USCardForum topics to control when you receive alerts. Choose from muted, normal, tracking, or watching levels to manage topic updates.

Instructions

Set your notification level for a topic. REQUIRES AUTHENTICATION. Args: topic_id: The topic ID to subscribe to level: Notification level: - 0: Muted (no notifications) - 1: Normal (only if mentioned) - 2: Tracking (notify on replies to your posts) - 3: Watching (notify on all new posts) Must call login() first. Returns a SubscriptionResult with: - success: Whether subscription succeeded - notification_level: The new notification level Use to: - Watch topics for all updates (level=3) - Mute noisy topics (level=0) - Track topics you've contributed to (level=2)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topic_idYesThe topic ID to subscribe to
levelNoNotification level: 0=muted, 1=normal, 2=tracking (default), 3=watching

Implementation Reference

  • MCP tool handler implementing 'subscribe_topic'. Includes input schema via Annotated[Field] descriptions, comprehensive docstring, and delegates to DiscourseClient.subscribe_topic after authentication.
    @mcp.tool() def subscribe_topic( topic_id: Annotated[ int, Field(description="The topic ID to subscribe to"), ], level: Annotated[ int, Field( default=2, description="Notification level: 0=muted, 1=normal, 2=tracking (default), 3=watching", ), ] = 2, ) -> SubscriptionResult: """ Set your notification level for a topic. REQUIRES AUTHENTICATION. Args: topic_id: The topic ID to subscribe to level: Notification level: - 0: Muted (no notifications) - 1: Normal (only if mentioned) - 2: Tracking (notify on replies to your posts) - 3: Watching (notify on all new posts) Must call login() first. Returns a SubscriptionResult with: - success: Whether subscription succeeded - notification_level: The new notification level Use to: - Watch topics for all updates (level=3) - Mute noisy topics (level=0) - Track topics you've contributed to (level=2) """ return get_client().subscribe_topic(topic_id, level=level)
  • Registration via import and re-export of subscribe_topic from auth.py in the server_tools package __init__.
    from .auth import ( login, get_current_session, get_notifications, bookmark_post, subscribe_topic, )
  • Imports subscribe_topic tool into the MCP server entrypoint for exposure to the mcp server.
    resource_new_topics, search_forum, subscribe_topic, )
  • Supporting client-side implementation that wraps AuthAPI.subscribe_topic, converting level to NotificationLevel enum.
    def subscribe_topic( self, topic_id: int, level: int = 2, ) -> SubscriptionResult: """Set topic notification level (requires auth). Args: topic_id: Topic ID level: 0=muted, 1=normal, 2=tracking, 3=watching Returns: Subscription result """ return self._auth.subscribe_topic(topic_id, level=NotificationLevel(level))
  • Core API helper that performs the actual HTTP POST request to the Discourse forum's /t/{topic_id}/notifications endpoint to set the notification level.
    def subscribe_topic( self, topic_id: int, level: NotificationLevel = NotificationLevel.TRACKING, ) -> SubscriptionResult: """Set topic notification level (requires auth). Args: topic_id: Topic ID level: Notification level (MUTED, NORMAL, TRACKING, WATCHING) Returns: Subscription result """ self._require_auth() if not isinstance(level, NotificationLevel): level = NotificationLevel(level) token = self._csrf_token or self.fetch_csrf_token() headers = { "Accept": "*/*", "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", "X-CSRF-Token": token, "X-Requested-With": "XMLHttpRequest", "Referer": f"{self._base_url}/t/{int(topic_id)}", } self._post( f"/t/{int(topic_id)}/notifications", data={"notification_level": str(int(level))}, headers=headers, ) return SubscriptionResult(success=True, notification_level=level)

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