Skip to main content
Glama

get_grades

Retrieve current grades for a specific course or all enrollments. Supports filtering by course ID.

Instructions

Current grades. Per-course if course_id provided, otherwise all enrollments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'get_grades' tool handler function. Decorated with @mcp.tool(), it fetches grades from Canvas LMS API. If course_id is provided, it fetches enrollments for that course; otherwise it fetches all active enrollments for the self user. Returns a list of dicts with course_id, grade, and type.
    @mcp.tool()
    def get_grades(course_id: int | None = None) -> list[dict]:
        """Current grades. Per-course if course_id provided, otherwise all enrollments."""
        if course_id:
            en = _get(f"/api/v1/courses/{course_id}/enrollments", user_id="self")
        else:
            en = _get("/api/v1/users/self/enrollments", **{"state[]": "active"})
        return [{"course_id": e.get("course_id"), "grade": e.get("grades"), "type": e.get("type")} for e in en]
  • The FastMCP server instance used to register the tool via the @mcp.tool() decorator on line 113.
    mcp = FastMCP("canvas-local")
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 describes the tool as returning 'current grades,' implying a read operation, but it does not explicitly state read-only nature, latency, or other behaviors like whether data is cached or if there are access restrictions.

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

Conciseness5/5

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

The description is extremely concise at two sentences, with the key information front-loaded ('Current grades.'). Every word adds value, making it efficient for an AI agent to parse.

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?

The description covers the tool's purpose and parameter behavior sufficiently, but it omits details about the output format despite having an output schema. It does not mention data freshness, authentication, or other contextual cues that could be helpful.

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?

With 0% schema description coverage, the description compensates well by explaining the conditional behavior of the course_id parameter: per-course if provided, otherwise all enrollments. This adds clear meaning beyond the schema's type and default.

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 retrieves current grades and distinguishes between per-course and all enrollments based on the course_id parameter. While it is specific, it could more explicitly differentiate from sibling tools like list_assignments, but the focus on grades is adequate.

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

Usage Guidelines3/5

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

The description provides guidance on when to use the tool with a course_id versus without, but it does not mention when not to use it or suggest alternatives among siblings. This is acceptable for a simple tool but lacks broader usage context.

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