Skip to content
Skill

Moodle web services

Guides building and calling Moodle web services: external functions, tokens and schemas

Moodle web services is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
44
Last commit
License
MIT
Listing updated

Similar skills

About Moodle web services

This skill walks the agent through exposing Moodle plugin code as web services. It covers registering functions and services in db/services.php, writing external function classes under classes/external/, and declaring typed parameter and return structures so inputs and outputs are checked.

The guidance stresses a fixed order inside each external function: validate parameters, validate the context, check capabilities, run the business logic, then format output. It also describes calling the same function over REST, AJAX from the browser, and SOAP or XMLRPC, along with token issuance, file upload and download flows, and tests that clean return values against their schema.

Working with it assumes a Moodle codebase and PHP plugin development. The skill notes that UI-only plugin code without remote callers belongs to a different plugin development skill.

When your agent uses it

Use when adding/calling Moodle web services or external functions — db/services.php, classes/external/, REST/SOAP/AJAX protocols, tokens, capabilities, parameters/returns schemas, file uploads, and rate limiting.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (10 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the moodle-dev plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add SaadRahman01/claude-moodle-dev
/plugin install moodle-dev@moodle-dev

Or copy only this skill to ~/.claude/skills/moodle-web-services:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/moodle-web-services &&
cp -R "$tmp/skills/moodle-web-services" ~/.claude/skills/moodle-web-services &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/moodle-web-services inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/moodle-web-services to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/moodle-web-services &&
cp -R "$tmp/skills/moodle-web-services" ~/.agents/skills/moodle-web-services &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/moodle-web-services inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/moodle-web-services to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/moodle-web-services &&
cp -R "$tmp/skills/moodle-web-services" ~/.cursor/skills/moodle-web-services &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/moodle-web-services inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/SaadRahman01/claude-moodle-dev.git --path skills/moodle-web-services

Or copy the folder to ~/.gemini/skills/moodle-web-services yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/moodle-web-services:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/moodle-web-services &&
cp -R "$tmp/skills/moodle-web-services" ~/.copilot/skills/moodle-web-services &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/moodle-web-services inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git

Then copy claude-moodle-dev/skills/moodle-web-services into your agent's skills folder as moodle-web-services. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Service registration
Defines functions and services in db/services.php, including capabilities, mobile exposure and AJAX access.
External function classes
Shows the structure of execute, parameter and return definitions for external API classes.
Parameter type reference
Lists Moodle PARAM_* types and value flags for validating inputs.
Token and REST calls
Covers issuing tokens and calling functions through the REST server with curl examples.
File upload and download
Describes moving draft uploads into plugin file areas and serving files through pluginfile.php.
Security checklist
Lists common mistakes such as missing context validation and unformatted output.

Good for

  • Add a new web service function that a mobile app can call
  • Define a service bundle with restricted users and token access
  • Debug an 'Invalid response value' error from a Moodle external function
  • Accept a file upload through a web service and save it to a plugin file area
  • Write a PHPUnit test that validates a function's return schema

Moodle web services FAQ

Which Moodle version does Moodle web services cover for namespaces?

It lists the namespace difference: Moodle 4.2 and later use core_external\external_api, while 4.1 and earlier use the bare external_api class.

Does Moodle web services add a built-in rate limit for tokens?

No. The skill states there is no built-in per-token rate limit and suggests custom middleware or a reverse-proxy limit instead.

What must be done after changing db/services.php?

Bump version.php and run the Moodle upgrade script so the service registers.

Does Moodle web services need any scripts or tools to run?

The skill itself ships as a single SKILL.md file with no scripts; it is guidance for an agent working in a Moodle codebase.

How do I install Moodle web services in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/moodle-web-services to use it in all your projects, or to .claude/skills/moodle-web-services in one project. Or install the moodle-dev plugin, which includes it: /plugin marketplace add SaadRahman01/claude-moodle-dev, then /plugin install moodle-dev@moodle-dev.

Does Moodle web services run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Moodle web services?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Moodle web services?

The closest alternatives to Moodle web services are Moodle plugin development, Moodle mobile app, Moodle phpunit testing, Moodle security audit and Moodle accessibility.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from SaadRahman01/claude-moodle-dev

  1. Guides agents to build Moodle plugin UI that meets WCAG 2.1 AA accessibility rules

    • Open source
    • 44 GitHub stars
    • Developer tools
  2. Guides writing Moodle browser JavaScript as AMD modules with grunt builds and tests

    • Open source
    • 44 GitHub stars
    • Developer tools
  3. Guides writing and running Behat acceptance tests for Moodle plugins

    • Open source
    • 44 GitHub stars
    • Developer tools
  4. Guides building and migrating Moodle 4.4+ hook classes, listeners and tests

    • Open source
    • 44 GitHub stars
    • Developer tools
  5. Guides building Moodle plugin UI that renders inside the Moodle Mobile app

    • Open source
    • 44 GitHub stars
    • Developer tools
  6. Guides an agent through performance tuning for Moodle plugins: caching, queries, tasks

    • Open source
    • 44 GitHub stars
    • Developer tools