get_all_courses
Retrieve all available courses and their URLs from the Moodle learning platform for accessing course materials and managing academic content.
Instructions
Get all available courses and URLs from Moodle.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:108-113 (handler)Handler function that retrieves all courses from the MUSTerClient and formats them as a list of dictionaries containing course name and URL.def tool_get_all_courses() -> List[Dict[str, str]]: try: courses = muster_client.get_courses() return [{"name": course.name, "url": course.url} for course in courses] except Exception as e: return [{"error": f"Failed to get courses: {str(e)}"}]
- main.py:26-30 (schema)Schema definition for the get_all_courses tool, specifying name, description, and no input parameters.Tool( name="get_all_courses", description="Get all available courses and URLs from Moodle.", inputSchema={"type": "object", "properties": {}, "required": []}, ),
- main.py:207-208 (registration)Registration and dispatch logic in the call_tool handler that maps the tool name to its handler function.if name == "get_all_courses": return _wrap_json(tool_get_all_courses())