Skip to main content
Glama

list_announcements

Retrieve course announcements from Canvas LMS by providing a course identifier to access important updates and information.

Instructions

List announcements for a specific course.

    Args:
        course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_identifierYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'list_announcements' MCP tool. It resolves the course ID, fetches discussion topics filtered as announcements using Canvas API parameters 'include[]=announcement' and 'only_announcements=true', formats the results with ID, title, and posted date, and returns a formatted string list.
    async def list_announcements(course_identifier: str) -> str:
        """List announcements for a specific course.
    
        Args:
            course_identifier: The Canvas course code (e.g., badm_554_120251_246794) or ID
        """
        course_id = await get_course_id(course_identifier)
    
        params = {
            "include[]": ["announcement"],
            "only_announcements": True,
            "per_page": 100
        }
    
        announcements = await fetch_all_paginated_results(f"/courses/{course_id}/discussion_topics", params)
    
        if isinstance(announcements, dict) and "error" in announcements:
            return f"Error fetching announcements: {announcements['error']}"
    
        if not announcements:
            return f"No announcements found for course {course_identifier}."
    
        announcements_info = []
        for announcement in announcements:
            announcement_id = announcement.get("id")
            title = announcement.get("title", "Untitled announcement")
            posted_at = format_date(announcement.get("posted_at"))
    
            announcements_info.append(
                f"ID: {announcement_id}\nTitle: {title}\nPosted: {posted_at}\n"
            )
    
        course_display = await get_course_code(course_id) or course_identifier
        return f"Announcements for Course {course_display}:\n\n" + "\n".join(announcements_info)
  • Within register_all_tools, this line calls register_discussion_tools(mcp), which registers the list_announcements tool (along with other discussion/announcement tools) to the MCP server.
    register_discussion_tools(mcp)
  • Import of register_discussion_tools from .tools, which contains the registration logic for list_announcements.
    register_messaging_tools,
  • Imports helper functions get_course_id and get_course_code used in list_announcements to resolve course_identifier to numeric ID.
    from ..core.cache import get_course_code, get_course_id
    from ..core.client import fetch_all_paginated_results, make_canvas_request
  • Imports fetch_all_paginated_results core client helper used to fetch paginated announcements from Canvas API.
    from ..core.dates import format_date, truncate_text
    from ..core.logging import log_error, log_warning
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool lists announcements but doesn't describe key behaviors: whether it's read-only (implied but not stated), how results are returned (e.g., paginated, sorted), error conditions, or permissions required. For a tool with no annotations, this leaves significant gaps in understanding its 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?

The description is concise and well-structured: a clear purpose statement followed by parameter details in a formatted block. It avoids unnecessary words and front-loads the main functionality. However, the parameter explanation could be integrated more smoothly (e.g., as a single sentence) for slightly better flow.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter) and the presence of an output schema (which handles return values), the description is minimally adequate. It covers the purpose and parameter semantics but lacks behavioral details (e.g., pagination, errors) and usage guidelines. With no annotations, it should provide more context about how the tool behaves in practice.

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

Parameters4/5

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

The description adds meaningful context for the single parameter: it explains that 'course_identifier' can be a Canvas course code or ID, with an example ('badm_554_120251_246794'). Since schema description coverage is 0% (the schema only provides a title and type), this compensates well by clarifying the parameter's format and usage, though it doesn't cover edge cases or validation rules.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'List announcements for a specific course.' It specifies the verb ('List') and resource ('announcements'), and distinguishes it from siblings like 'create_announcement' or 'delete_announcement'. However, it doesn't explicitly differentiate from similar listing tools (e.g., 'list_discussion_topics'), which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_course_details' (which might include announcements) or specify scenarios where this tool is preferred over others. The only context is the required parameter, but no usage context is given.

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

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