Skip to main content
Glama

canvas_list_announcements

Retrieve and display all course announcements in Canvas using the specified course ID to streamline access to important updates.

Instructions

List all announcements in a course

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYesID of the course

Implementation Reference

  • The core Canvas API client method implementing the logic to list announcements for a given course by querying discussion topics with type='announcement'. This is the primary handler logic for the tool.
    async listAnnouncements(courseId: string): Promise<CanvasAnnouncement[]> {
      const response = await this.client.get(`/courses/${courseId}/discussion_topics`, {
        params: {
          type: 'announcement',
          include: ['assignment']
        }
      });
      return response.data;
    }
  • src/index.ts:559-568 (registration)
    Tool registration in the TOOLS array, defining the tool name, description, and input schema for MCP tool listing.
      name: "canvas_list_announcements",
      description: "List all announcements in a course",
      inputSchema: {
        type: "object",
        properties: {
          course_id: { type: "number", description: "ID of the course" }
        },
        required: ["course_id"]
      }
    },
  • Usage of the listAnnouncements method in the MCP resource reading handler for announcements://course_id resources.
    case "announcements":
      content = await this.client.listAnnouncements(id);
      break;
  • TypeScript interface defining the structure of CanvasAnnouncement objects returned by the tool.
    export interface CanvasAnnouncement {
      id: number;
      title: string;
      message: string;
      posted_at: string;
      html_url: string;
      user_has_posted: boolean;
      discussion_subentry_count: number;
    }
  • src/index.ts:1071-1073 (registration)
    MCP server registration of all tools including canvas_list_announcements via ListToolsRequestSchema handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: TOOLS
    }));
Install Server

Other Tools

Related 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/DMontgomery40/mcp-canvas-lms'

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