Skip to main content
Glama
hmumixaM

USCardForum MCP Server

by hmumixaM

get_notifications

Fetch user notifications from USCardForum to check replies, mentions, likes, and topic updates. Requires authentication and supports filtering by recency, read status, and quantity.

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
NameRequiredDescriptionDefault
since_idNoOnly get notifications newer than this ID
only_unreadNoOnly return unread notifications
limitNoMaximum number to return

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main MCP tool handler for 'get_notifications'. Defines input schema with Pydantic Field annotations and delegates execution to the DiscourseClient instance via get_client().
    @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
        )
  • Core API implementation in AuthAPI that fetches notifications from /notifications.json, parses them into Notification models, and applies client-side filtering based on parameters.
    def get_notifications(
        self,
        since_id: int | None = None,
        only_unread: bool = False,
        limit: int | None = None,
    ) -> list[Notification]:
        """Fetch notifications (requires auth).
    
        Args:
            since_id: Only notifications after this ID
            only_unread: Only unread notifications
            limit: Maximum notifications to return
    
        Returns:
            List of notification objects
        """
        self._require_auth()
        payload = self._get("/notifications.json")
        raw_notifications = payload.get("notifications", [])
    
        notifications = [Notification(**n) for n in raw_notifications]
    
        # Apply filters
        if since_id is not None:
            notifications = [n for n in notifications if n.id > since_id]
        if only_unread:
            notifications = [n for n in notifications if not n.read]
        if limit is not None:
            notifications = notifications[: max(0, int(limit))]
    
        return notifications
  • Client-side wrapper method in DiscourseClient that delegates the get_notifications call to the underlying AuthAPI instance.
    def get_notifications(
        self,
        since_id: int | None = None,
        only_unread: bool = False,
        limit: int | None = None,
    ) -> list[Notification]:
        """Fetch notifications (requires auth).
    
        Args:
            since_id: Only notifications after this ID
            only_unread: Only unread notifications
            limit: Maximum notifications to return
    
        Returns:
            List of notification objects
        """
        return self._auth.get_notifications(
            since_id=since_id, only_unread=only_unread, limit=limit
        )
  • Import of the get_notifications tool in the main server entrypoint, ensuring it is loaded and registered via the @mcp.tool() decorator.
    get_notifications,
  • Export of get_notifications from server_tools.auth in the tools __init__.py, making it available for import in server.py.
    get_notifications,
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 disclosing authentication requirement ('REQUIRES AUTHENTICATION'), pagination behavior via limit parameter, and filtering capabilities. It also describes the return format in detail. Could improve by mentioning rate limits or any destructive effects (though likely none for a fetch operation).

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

Conciseness4/5

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

Well-structured with clear sections: purpose statement, parameter documentation, prerequisite, return format, and use cases. Could be slightly more concise by integrating parameter details more efficiently, but overall information density is good with minimal waste.

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 has an output schema (implied by the detailed return format description) and 100% schema coverage, the description provides excellent contextual completeness. It covers authentication requirements, parameter usage, return format, and specific use cases, making it fully sufficient for an agent to understand and use the tool correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already fully documents all three parameters. The description repeats the parameter information but doesn't add significant semantic context beyond what's in the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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 verb 'fetch' and resource 'notifications', distinguishing it from sibling tools like get_user_actions or get_user_replies which focus on different data types. It specifies retrieving notifications specifically, not other user data.

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

Usage Guidelines5/5

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

Explicitly states 'Must call login() first' for authentication prerequisite and provides clear use cases: 'Check for new replies to your posts', 'See mentions and likes', 'Track topic updates you're watching'. This gives concrete guidance on when to use this tool versus alternatives.

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

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