get_all_courses
Retrieve all available courses and their URLs from the Moodle platform for academic access and management.
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)The handler function `tool_get_all_courses` that fetches and returns all available Moodle courses as a list of dictionaries with name and URL, handling exceptions gracefully.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)The input schema definition for the `get_all_courses` tool, specifying no required 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 of the `get_all_courses` tool in the MCP `call_tool` dispatch handler, mapping the tool name to its execution.if name == "get_all_courses": return _wrap_json(tool_get_all_courses())
- main.py:198-200 (registration)MCP server decorator registering the `list_tools` handler which includes the `get_all_courses` tool schema via `list_muster_tools()`.@server.list_tools() async def list_tools() -> List[Tool]: return list_muster_tools()