public static function get_description($tool) {
        global $DB;
        $description = '';
        $context = \context::instance_by_id($tool->contextid);
        if ($context->contextlevel == CONTEXT_COURSE) {
            $course = $DB->get_record('course', array('id' => $context->instanceid));
            $description = $course->summary;
        } else if ($context->contextlevel == CONTEXT_MODULE) {
            $cmid = $context->instanceid;
            $cm = get_coursemodule_from_id(false, $context->instanceid, 0, false, MUST_EXIST);
            $module = $DB->get_record($cm->modname, array('id' => $cm->instance));
            $description = $module->intro;
        }
        return trim(html_to_text($description));
    }