Skip to main content
Glama

list_announcements

Retrieve all announcements for a specific Canvas course by providing the course ID.

Instructions

Course announcements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the list_announcements tool. It takes a course_id and calls the Canvas API endpoint /api/v1/courses/{course_id}/discussion_topics with only_announcements=True.
    def list_announcements(course_id: int) -> list[dict]:
        """Course announcements."""
        return _get(f"/api/v1/courses/{course_id}/discussion_topics", only_announcements=True)
  • The registration decorator @mcp.tool() that registers list_announcements as an MCP tool.
    @mcp.tool()
  • The _get helper function used by list_announcements to make HTTP GET requests to the Canvas API, handling pagination.
    def _get(path: str, **params) -> Any:
        params.setdefault("per_page", 100)
        url = f"{BASE}{path}"
        out = []
        with httpx.Client(headers=HEAD, timeout=30) as c:
            while url:
                r = c.get(url, params=params)
                r.raise_for_status()
                data = r.json()
                if isinstance(data, list):
                    out.extend(data)
                else:
                    return data
                url = None
                params = {}
                link = r.headers.get("Link", "")
                for part in link.split(","):
                    if 'rel="next"' in part:
                        url = part[part.find("<")+1:part.find(">")]
        return out
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It does not mention whether this is a read operation, what data is returned, or any side effects.

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

Conciseness2/5

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

Extremely brief (two words) to the point of under-specification. It is not concise in a helpful way; it omits essential information.

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

Completeness2/5

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

For a simple tool with one parameter and an output schema, the description is incomplete. It fails to clarify what announcements are listed, which course, or any filtering. The output schema exists but is not referenced.

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

Parameters1/5

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

Input schema has one required parameter (course_id) with 0% description coverage. The description 'Course announcements' adds no meaning to the parameter or its usage.

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

Purpose2/5

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

Description 'Course announcements' is vague; it restates the topic but fails to specify the action (listing). The tool's name implies listing, but the description adds little clarity.

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?

No guidance on when to use this tool, prerequisites, or alternatives. Sibling tools like list_assignments or planner_items might overlap, but no differentiation is provided.

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

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