Skip to main content
Glama

get_unread_count

Retrieve the number of unread conversations in Canvas LMS to monitor new messages and stay updated on course communications.

Instructions

Get number of unread conversations. Returns: Unread conversation count

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_unread_count' tool. It makes an API request to Canvas's /conversations/unread_count endpoint, handles errors, and returns the unread count or error details. The @mcp.tool() decorator registers this function as an MCP tool.
    @mcp.tool() async def get_unread_count() -> dict[str, Any]: """ Get number of unread conversations. Returns: Unread conversation count """ try: response = await make_canvas_request("get", "/conversations/unread_count") if "error" in response: return response return { "success": True, "unread_count": response.get("unread_count", 0) } except Exception as e: print(f"Error getting unread count: {str(e)}", file=sys.stderr) return {"error": f"Failed to get unread count: {str(e)}"}
  • Within register_all_tools, this call to register_messaging_tools(mcp) executes the registration of the messaging tools module, including the get_unread_count tool via its decorator.
    register_messaging_tools(mcp)

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/vishalsachdev/canvas-mcp'

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