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 30 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, the lesson list, and the index.qmd content 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.
search_filesFind every file whose text matches a string or a regex, with the matching lines and line numbers.
semantic_searchThe files most related in meaning to a query, from the course's search index. Candidates only: read the text before you change a file.
report_referencesEach dangling reference (with its file and line) and each unused asset.
list_referencesThe entries of the course's references.bib, with their citation keys.
list_slidesA RevealJS deck's slides in order, each with its index, title, excerpt and hash.
read_slideOne slide's exact text and hash, by its 0-based index.
list_course_reposThe course's linked GitHub code repositories and the status of every branch link.
restore_snapshotA proposal to restore course files from a Git commit. It applies nothing: apply what the person confirms with apply_ops.

The search, references report and slide tools need MCP phase 2 or higher. None of the read tools changes anything.

Write tools - require Read + Write scope

ToolDescription
create_courseCreate a new course with a title and optional description.
update_courseUpdate the course title, description or AI context brief. The change is logged and can be put back.
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. Must pass "confirm": true, after asking the person. The change is logged and can be put back.
set_ai_contextSet the AI context brief for a course. The change is logged and can be put back.
write_fileCreate or overwrite any course file by path (upsert). Image types require base64 content.
apply_opsApply a confirmed batch of course-change ops (as returned by chat or restore_snapshot) on the server: file, sidebar, slide, theme, plan, Git, Pages and course ops. A delete, a publish, a Git commit or a Pages change needs its index in approved_always_ask.
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
}

Ask the person before you send "confirm": true, and never set it on your own. Without it, delete_file, delete_lesson and publish_course change nothing. The answer is a confirmation_required error that says what would happen and how to confirm.

Every write tool also runs the governed check. A write that would change a field a programme governs is refused with governed_field and nothing changes; send it as a change request in the editor instead. If CourseFoundry cannot read whether a field is governed, the write is refused with classify_unavailable.

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.