get_notifications
Fetch user notifications from USCardForum to check replies, mentions, likes, and topic updates, with options to filter by recency and read status.
Instructions
Fetch your notifications. REQUIRES AUTHENTICATION.
Args:
since_id: Only get notifications newer than this ID (optional)
only_unread: Only return unread notifications (default: False)
limit: Maximum number to return (optional)
Must call login() first.
Returns a list of Notification objects with:
- id: Notification ID
- notification_type: Type of notification
- read: Whether read
- topic_id: Related topic
- post_number: Related post
- created_at: When created
Use to:
- Check for new replies to your posts
- See mentions and likes
- Track topic updates you're watching
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| since_id | No | Only get notifications newer than this ID | |
| only_unread | No | Only return unread notifications | |
| limit | No | Maximum number to return |
Implementation Reference
- The MCP tool handler for 'get_notifications', decorated with @mcp.tool(). Defines input schema via Annotated[Field] and delegates execution to the underlying client implementation.@mcp.tool() def get_notifications( since_id: Annotated[ int | None, Field(default=None, description="Only get notifications newer than this ID"), ] = None, only_unread: Annotated[ bool, Field(default=False, description="Only return unread notifications"), ] = False, limit: Annotated[ int | None, Field(default=None, description="Maximum number to return"), ] = None, ) -> list[Notification]: """ Fetch your notifications. REQUIRES AUTHENTICATION. Args: since_id: Only get notifications newer than this ID (optional) only_unread: Only return unread notifications (default: False) limit: Maximum number to return (optional) Must call login() first. Returns a list of Notification objects with: - id: Notification ID - notification_type: Type of notification - read: Whether read - topic_id: Related topic - post_number: Related post - created_at: When created Use to: - Check for new replies to your posts - See mentions and likes - Track topic updates you're watching """ return get_client().get_notifications( since_id=since_id, only_unread=only_unread, limit=limit )
- src/uscardforum/models/auth.py:66-80 (schema)Pydantic model defining the output schema for notifications returned by the tool.class Notification(BaseModel): """A user notification.""" id: int = Field(..., description="Notification ID") notification_type: int = Field(..., description="Type of notification") read: bool = Field(False, description="Whether read") created_at: datetime | None = Field(None, description="When created") topic_id: int | None = Field(None, description="Related topic ID") post_number: int | None = Field(None, description="Related post number") slug: str | None = Field(None, description="Topic slug") data: dict[str, Any] = Field(default_factory=dict, description="Extra data") class Config: extra = "ignore"
- src/uscardforum/server.py:15-45 (registration)Imports the get_notifications tool (line 25) along with all other MCP tools into the main FastMCP server entrypoint for registration and exposure.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, )
- src/uscardforum/server_tools/__init__.py:52-58 (registration)Imports get_notifications from the auth module into the server_tools package __init__.py for package-level exposure and __all__ inclusion.from .auth import ( login, get_current_session, get_notifications, bookmark_post, subscribe_topic, )