Reference

API reference

Every tool, resource, prompt, and AI workflow exposed by the CourseFoundry endpoint at POST https://www.coursefoundry.com/api/mcp.

Tools

Call a tool with the tools/call method. There are 22 tools across four groups.

Read tools - available on all key scopes

ToolDescription
list_coursesList all courses owned by the authenticated user.
read_courseGet course metadata, file list, and AI context for a course.
get_lessonRead the content of a specific lesson file.
get_ai_contextGet the AI context (Smithy config) for a course.
list_filesList every file in a course with a sha256 hash, byte size, and encoding - so a client can diff a local copy without downloading bodies.
read_fileRead any file by path - config, references, stylesheets, images, lessons. Text returns encoding utf8; images return raw base64.
list_placeholdersList a course's image placeholders with their AI prompt, designer brief, target pixel size, every file and line that uses them, and a free suggested_path to save the finished image at.

Write tools - require Read + Write scope

ToolDescription
create_courseCreate a new course with a title and optional description.
update_courseUpdate course metadata (title, description, slug).
create_lessonCreate a new lesson file at a given path.
update_lessonUpdate the content of an existing lesson file.
publish_coursePublish or unpublish a course.
set_ai_contextSet the AI Smithy context for a course.
write_fileCreate or overwrite any course file by path (upsert). Image types require base64 content.
apply_opsApply a batch of proposed course-change ops (as returned by chat) to the course.
update_placeholderSave a refined label, description, AI prompt or designer brief for one placeholder. Only the fields you send change.
resolve_placeholdersReplace 1-50 placeholders with images already uploaded to the course (via write_file), rewriting every reference to a relative path. All or nothing; a refusal lists every failing pair.

Destructive tools - require Read + Write scope and confirm: true

ToolDescription
delete_lessonDelete a lesson file. Must pass "confirm": true.
delete_courseDelete an entire course. Must pass "confirm": true.
delete_fileDelete any course file by path. Must pass "confirm": true.
json
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "delete_lesson",
    "arguments": {
      "course_id": "YOUR_COURSE_ID",
      "path": "module-2/old-draft.qmd",
      "confirm": true
    }
  },
  "id": 1
}

AI tools

ToolDescription
run_workflowRun a named AI workflow and return the generated content. Consumes AI credits.
chatAsk the course copilot a question in context. Returns the reply plus any proposed change ops, which you apply with apply_ops. Consumes AI credits.

run_workflow - AI generation

The run_workflow tool runs one of CourseFoundry's AI workflows and returns generated text. Each call consumes AI credits from your plan. Request shape:

json
{
  "name": "run_workflow",
  "arguments": {
    "workflow": "<workflow_name>",
    "context": { ... }
  }
}

Available workflows

WorkflowPurposeKey context fields
outlineStructured course outline with modules and lesson titles.title, description
lessonFull lesson body in Quarto Markdown.courseTitle, lessonTitle, outline
slidesConvert lesson content into a slide-ready format.lessonContent, courseTitle, lessonTitle
assessmentQuiz questions and assessment items for a lesson.lessonContent, courseTitle
reviewCritique a lesson for clarity, accuracy, and instructional quality.lessonContent, courseTitle
importConvert raw unstructured content into a structured QMD lesson.rawContent, courseTitle
suggest_outcomesSuggest SMART learning outcomes for a course.courseTitle, courseDescription

Example - generate an outline:

json
{
  "workflow": "outline",
  "context": {
    "title": "Intro to Rust",
    "description": "A beginner course covering ownership, traits, and async."
  }
}

Resources

Resources expose structured data for LLM consumption. Use resources/list to discover them and resources/read to fetch one.

URIDescription
coursefoundry://user/profileAuthenticated user profile (plan, credits, username).
coursefoundry://coursesList of all courses.
coursefoundry://course/{id}Single course detail.
coursefoundry://course/{id}/lessonsAll lessons in a course.
bash
curl -X POST https://www.coursefoundry.com/api/mcp \
  -H "Authorization: Bearer cfry_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "resources/read",
    "params": { "uri": "coursefoundry://courses" },
    "id": 1
  }'

Prompts

Use prompts/list to discover built-in prompt templates and prompts/get to retrieve one.

NameDescription
create-courseGuided prompt for creating a new course from scratch.
improve-outcomesPrompt for refining learning outcomes.
generate-lessonPrompt for generating a new lesson in a course.
fill-image-placeholdersStep-by-step prompt for an agent to produce and resolve a course's image placeholders.

Key scopes

Create a Read-scoped key for CI that only queries data, public integrations, monitoring tools, or anywhere write access would be a security risk. Read-only keys block all write, destructive, and AI tools - a 403 with read_only_scope is returned if a write tool is called. For anything that authors content, use a Read + Write key.