Skip to main content
Glama

get_course_content

Retrieve assignments and resources for a specific course from the MUSTer MCP Server to access learning materials and track academic requirements.

Instructions

Get all assignments/resources for a course by exact name (call get_all_courses first).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_nameYesCourse name exactly as returned by get_all_courses

Implementation Reference

  • main.py:31-44 (registration)
    Registration of the MCP tool 'get_course_content' defining its name, description, and input schema.
    Tool(
        name="get_course_content",
        description="Get all assignments/resources for a course by exact name (call get_all_courses first).",
        inputSchema={
            "type": "object",
            "properties": {
                "course_name": {
                    "type": "string",
                    "description": "Course name exactly as returned by get_all_courses",
                }
            },
            "required": ["course_name"],
        },
    ),
  • main.py:35-43 (schema)
    Input schema definition for the tool, specifying 'course_name' as required string parameter.
        "type": "object",
        "properties": {
            "course_name": {
                "type": "string",
                "description": "Course name exactly as returned by get_all_courses",
            }
        },
        "required": ["course_name"],
    },
  • main.py:116-141 (handler)
    Primary MCP tool handler: resolves course by name, fetches content via MUSTerClient, formats as list of dicts with error handling.
    def tool_get_course_content(course_name: str) -> List[Dict[str, Any]]:
        try:
            all_courses = muster_client.get_courses()
    
            match = next((c for c in all_courses if c.name == course_name), None)
            if not match:
                return [{"error": f"No courses found matching '{course_name}'. Please call get_all_courses first."}]
    
            try:
                assignments = muster_client.get_course_content(match.url)
                return [
                    {
                        "name": assignment.name,
                        "type": assignment.type,
                        "url": assignment.url,
                        "course_name": match.name,
                        "course_url": match.url,
                    }
                    for assignment in assignments
                ]
            except Exception as e:
                return [{"error": f"Failed to get content from course '{match.name}': {str(e)}"}]
    
        except Exception as e:
            return [{"error": f"Failed to get course content: {str(e)}"}]
  • Core helper method implementing the scraping logic: loads course page, iterates sections and activities, determines types, builds Assignment list.
    def get_course_content(self, course_url: str) -> List[Assignment]:
        """Get all assignments and content from a specific course."""
        self._ensure_driver()
        self.heartBeat()
        if not self.logged_in:
            if not self.login():
                raise Exception("Login required to get courses.")
    
        try:
            self.driver.get(course_url)
            WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located((By.CSS_SELECTOR, ".course-content, .topics, li.section"))
            )
            assignments = []
            sections = self.driver.find_elements(By.CSS_SELECTOR, "li.section.main")
            for section in sections:
                try:
                    section_title_element = section.find_element(By.CSS_SELECTOR, ".sectionname span a, .sectionname a")
                    section_title = section_title_element.text.strip()
                    if section_title.lower() in ["general", ""]:
                        continue
    
                    activities = section.find_elements(By.CSS_SELECTOR, ".activity")
                    for activity in activities:
                        try:
                            activity_link = activity.find_element(By.CSS_SELECTOR, ".activityinstance a")
                            instance_name_element = activity_link.find_element(By.CSS_SELECTOR, ".instancename")
                            activity_name = " ".join(instance_name_element.text.strip().split())
                            activity_url = activity_link.get_attribute('href')
                            activity_type = "resource"
                            if "forum" in activity.get_attribute("class"):
                                activity_type = "forum"
                            elif "assign" in activity.get_attribute("class"):
                                activity_type = "assignment"
                            elif "quiz" in activity.get_attribute("class"):
                                activity_type = "quiz"
                            elif "resource" in activity.get_attribute("class"):
                                activity_type = "file"
    
                            if activity_name and activity_url:
                                hierarchical_name = f"{section_title} > {activity_name}"
                                assignments.append(Assignment(
                                    name=hierarchical_name,
                                    type=activity_type,
                                    url=activity_url,
                                    course=section_title
                                ))
                        except Exception:
                            continue
                except Exception:
                    continue
            self.heartBeat()
            return assignments
        except TimeoutException:
            print(f"Timeout while waiting for course content to load for url: {course_url}")
            return []
        except Exception as e:
            print(f"An error occurred while getting course content: {e}")
            return []
  • main.py:209-210 (handler)
    Dispatch logic in MCP server.call_tool() that routes calls to the tool_get_course_content handler.
    if name == "get_course_content":
        return _wrap_json(tool_get_course_content(args["course_name"]))
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the prerequisite call but doesn't describe what 'Get all assignments/resources' returns (list format, pagination, error conditions), whether it's read-only or has side effects, or any authentication/rate limit considerations. The description provides minimal behavioral context beyond the basic operation.

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 (one sentence) with zero wasted words. It's front-loaded with the core purpose and efficiently includes the prerequisite information. Every element earns its place without redundancy.

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?

For a single-parameter read operation with no output schema, the description is minimally adequate. It covers the purpose and prerequisite but lacks details about return format, error handling, or behavioral traits. Given the simplicity of the tool (1 parameter, no annotations), it's borderline viable but leaves significant gaps in understanding the tool's behavior.

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 description coverage is 100%, so the schema already documents the single parameter 'course_name' with its exact format requirement. The description adds marginal value by reinforcing the 'exact name' constraint and linking it to 'get_all_courses,' but doesn't provide additional semantic context beyond what's in the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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: 'Get all assignments/resources for a course by exact name.' It specifies the verb ('Get'), resource ('assignments/resources'), and scope ('for a course'). However, it doesn't explicitly differentiate from sibling tools like 'download_resource' or 'get_all_courses' beyond the prerequisite call mention.

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?

The description provides clear usage context: 'call get_all_courses first' establishes a prerequisite workflow. It implies this tool should be used after retrieving course names from another tool. However, it doesn't explicitly state when NOT to use this tool or name alternatives for similar operations.

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/Cosmostima/MUSTer_MCP'

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