Skip to main content
Glama

Get Classlist Emails

get_classlist_emails

Fetch all email addresses for a course—instructors, TAs, and students—to enable direct communication with the entire class.

Instructions

Fetch all email addresses for everyone in a course — instructors, TAs, and students. Use this when the user wants a list of emails for a class, needs to email the whole class, or wants contact info for everyone enrolled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
courseIdYesCourse ID to get emails for.

Implementation Reference

  • The main handler function that registers and implements the 'get_classlist_emails' tool. It takes a courseId, fetches the classlist via the D2L API, extracts emails (filtering out nulls for privacy-hidden users), and returns the list of emails with name, email, and role.
    export function registerGetClasslistEmails(
      server: McpServer,
      apiClient: D2LApiClient
    ): void {
      server.registerTool(
        "get_classlist_emails",
        {
          title: "Get Classlist Emails",
          description:
            "Fetch all email addresses for everyone in a course — instructors, TAs, and students. " +
            "Use this when the user wants a list of emails for a class, needs to email the whole class, " +
            "or wants contact info for everyone enrolled.",
          inputSchema: GetClasslistEmailsSchema,
        },
        async (args: any) => {
          try {
            log("DEBUG", "get_classlist_emails tool called", { args });
    
            const { courseId } = GetClasslistEmailsSchema.parse(args);
    
            // Fetch full classlist (all roles) using paged endpoint
            const path = apiClient.le(courseId, "/classlist/paged/");
            const response = await apiClient.get<ClasslistResponse>(path, {
              ttl: DEFAULT_CACHE_TTLS.roster,
            });
    
            if (response.Next) {
              log(
                "WARN",
                "get_classlist_emails: Pagination detected but not implemented. Some users may be missing.",
                { courseId, next: response.Next }
              );
            }
    
            // Extract emails, filtering out nulls (privacy-hidden)
            const emails = response.Objects
              .filter((user) => user.Email)
              .map((user) => ({
                name: user.DisplayName,
                email: user.Email,
                role: user.ClasslistRoleDisplayName,
              }));
    
            log("INFO", `get_classlist_emails: ${emails.length} emails from ${response.Objects.length} users in course ${courseId}`);
            return toolResponse(emails);
          } catch (error) {
            return sanitizeError(error);
          }
        }
      );
    }
  • Input schema for get_classlist_emails — validates that courseId is a positive integer.
    export const GetClasslistEmailsSchema = z.object({
      courseId: z.coerce.number().int().positive()
        .describe("Course ID to get emails for."),
    });
  • src/index.ts:186-186 (registration)
    Where the tool is registered on the server — calls registerGetClasslistEmails(server, apiClient) in the main index.
    registerGetClasslistEmails(server, apiClient);
  • Barrel export re-exporting the registerGetClasslistEmails function from the tools module.
    export { registerGetClasslistEmails } from "./get-classlist-emails.js";
Behavior2/5

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

No annotations provided; description fails to disclose authentication requirements, side effects, or any behavioral traits. It implies a read operation but without explicit statement, leaving the agent without critical safety cues.

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?

Two sentences, no fluff, front-loaded with purpose then usage scenarios. Every sentence adds value.

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?

Simple tool with one parameter. Description covers purpose and usage but omits return format (e.g., list of emails, comma-separated). Adequate but could improve.

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

Parameters3/5

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

Schema covers the single parameter with a description. The tool description does not add additional semantic value beyond the schema, meeting baseline for 100% coverage.

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

Purpose5/5

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

The description clearly states it fetches email addresses for all roles (instructors, TAs, students) in a course. It uses specific verb and resource, and distinguishes from siblings like get_roster by focusing solely on emails.

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

Usage Guidelines4/5

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

Provides explicit usage scenarios such as when the user wants a list of emails for a class. Lacks explicit when-not-to-use or alternatives, but the context is clear enough.

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/RohanMuppa/brightspace-mcp-server'

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