Create LearnDash Course
Creates a new LearnDash course, authored by you. It is created as a draft that students cannot see unless publish is true; someone who may not publish courses gets a course pending review instead. Optionally sets how people get access (price_type) and the price. Reversible: the course can be edited or trashed in LearnDash afterwards. Add lessons with mosmcp/learndash-create-lesson.
Also known as: new course, add a course, build a course, start an online course.
| Property | Value |
|---|---|
| Ability slug | mosmcp/learndash-create-course |
| Wire tool name | mosmcp__learndash-create-course |
| Category | LearnDash (mosmcp-learndash) |
| Plan | Pro |
Required access
| Requirement | Value |
|---|---|
| Capability | edit_posts, plus the LearnDash course post type's create_posts capability (edit_courses) |
| Minimum default role | Contributor |
| Annotations | readOnly: false · destructive: false · idempotent: false · openWorld: false |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| title | string (min length 1) | Yes | — | The course title. |
| description | string | — | Optional course description, shown on the course page. HTML is saved the way the WordPress editor saves it: a user with the unfiltered_html capability can save any markup, including forms, scripts and styles, and markup a user is not allowed to save is refused with the reason rather than silently removed. Backslashes are kept. | |
| excerpt | string | — | Optional short summary of the course. | |
| price_type | string (one of open, free, paynow, subscribe, closed) |
— | How people get access: open (anyone, no sign-up), free (anyone who enrolls, logged in), paynow (a one-time price, needs price), or closed (only people enrolled by an admin, a group or an order). subscribe (a recurring price) is accepted only for a course that is already a subscription course, because its billing cycle is set up in LearnDash itself. | |
| price | number | null (min 0) | — | The course price in the site's currency, used by price_type paynow and subscribe. At most two decimals. null clears it. | |
| publish | boolean | false |
Publish the course straight away. Leave false to create a draft, which is what you want unless the person asked for it to go live. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| course | object | Yes | |
| course.course_id | integer | Yes | |
| course.title | string | Yes | |
| course.status | string | Yes | |
| course.price_type | string | open, free, paynow, subscribe or closed; empty when LearnDash has none stored. | |
| course.price | number | null | The stored price, or null when none is set. | |
| course.lesson_count | integer | ||
| course.topic_count | integer | ||
| course.quiz_count | integer | ||
| course.author | string | ||
| course.created_at | string | ||
| course.edit_url | string | LearnDash's course editor, where the course builder is. | |
| course.view_url | string | ||
| warnings | object[] | Notes about the save, such as markup that could not be kept. | |
| warnings[].code | string | ||
| warnings[].message | string | ||
| warnings[].context | string | ||
| notes | string[] |
Example
Sample prompt
Create a draft LearnDash course called 'Python for Analysts' that sells for 79 as a one-time purchase.
Example request (json)
{
"jsonrpc": "2.0",
"id": 670,
"method": "tools/call",
"params": {
"name": "mosmcp__learndash-create-course",
"arguments": {
"input": {
"title": "Python for Analysts",
"excerpt": "Clean, analyse and chart data with pandas.",
"price_type": "paynow",
"price": 79
}
}
}
}Example response (json)
{
"jsonrpc": "2.0",
"id": 670,
"result": {
"isError": false,
"structuredContent": {
"course": {
"course_id": 512,
"title": "Python for Analysts",
"status": "draft",
"price_type": "paynow",
"price": 79,
"lesson_count": 0,
"topic_count": 0,
"quiz_count": 0,
"author": "Priya Shah",
"created_at": "2026-11-19 10:05:42",
"edit_url": "https://example.com/wp-admin/post.php?post=512&action=edit",
"view_url": "https://example.com/?post_type=sfwd-courses&p=512"
},
"warnings": [],
"notes": [
"The course is a draft, so visitors and students cannot see it until it is published.",
"Add lessons with mosmcp/learndash-create-lesson."
]
}
}
}
Edge cases / errors
- Always a draft unless publish is true; someone who may not publish courses gets a course pending review instead, with a note.
- price_type "paynow" without a price above 0 → mosmcp_learndash_price_required; a price with more than two decimals → mosmcp_learndash_price_invalid.
- price_type "subscribe" → mosmcp_learndash_subscription_unsupported, because a billing cycle has to be set in LearnDash's course settings; use "paynow" for a one-time price.
- A title made only of markup or spaces → mosmcp_learndash_title_required.
| << Previous | Next >> |
|---|---|
| Create LearnDash Lesson |
For more information about the Secure MCP Server for WordPress plugin, explore the following resources:
Product Overview | Pricing | Try for Free | Documentation
If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.