moodle-web-services

moodle-web-services is a skill for Claude Code from SaadRahman01/claude-moodle-dev. It costs 50 tokens per session (2,411 once invoked), scanned A, original, MIT.

A guide for Moodle web services, which let mobile apps, JavaScript, and external systems call Moodle functions. It covers service definitions, authentication tokens, input and output formats, and file handling.

In plain words
What is it for?
It helps add or debug REST, AJAX, SOAP, and XML-RPC functions, define callable services, manage tokens and capabilities, describe data schemas, and return uploaded files.
Why use it?
It removes the guesswork from exposing Moodle plugin functions remotely and helps avoid errors caused by invalid parameters, response formats, or permissions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the moodle-dev plugin — 13 skills, 8 commands, 2 agents shipped together

Good fit It helps add or debug REST, AJAX, SOAP, and XML-RPC functions, define callable services, manage tokens and capabilities, describe data schemas, and return uploaded files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/saadrahman01/claude-moodle-dev/moodle-web-services
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add SaadRahman01/claude-moodle-dev --skill moodle-web-services
Clone the repo
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev

Made for: Claude Code.

Or install moodle-dev, the plugin that ships this one along with the rest of its 13 skills, 8 commands, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for moodle-web-services

README.md
[![agentmods](https://agentmods.dev/badge/skills/saadrahman01/claude-moodle-dev/moodle-web-services/github.svg)](https://agentmods.dev/skills/saadrahman01/claude-moodle-dev/moodle-web-services)
Your own site
<a href="https://agentmods.dev/skills/saadrahman01/claude-moodle-dev/moodle-web-services"><img src="https://agentmods.dev/badge/skills/saadrahman01/claude-moodle-dev/moodle-web-services/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for moodle-web-services

Your own site · 80×15
<a href="https://agentmods.dev/skills/saadrahman01/claude-moodle-dev/moodle-web-services"><img src="https://agentmods.dev/badge/skills/saadrahman01/claude-moodle-dev/moodle-web-services.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,411 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00050 $0.02411
Opus 5 $0.00025 $0.01205
Sonnet 5 $0.00010 $0.00482
Haiku 4.5 $0.00005 $0.00241

Measured 9d ago against content hash 3082ffd5448d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

moodle-web-services scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -X POST "$SITE/webservice/rest/server.php" \
skills/moodle-web-services/SKILL.md · 284 lines

How it starts

The opening of the file, as written. The whole thing — 284 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Moodle Web Services

Overview

Moodle exposes plugin functions as web services via db/services.php + classes/external/<fn>.php. Same function is callable as REST, AJAX, SOAP, or XMLRPC. Authentication is token-based for external clients, session-based for AJAX. All inputs/outputs are typed via external_value / external_single_structure / external_multiple_structure.

When to Use

  • Adding a function callable from mobile app, AMD JS, or external system
  • Defining a service (bundle of functions) for an external client
  • Issuing/managing tokens
  • Returning files via web service
  • Debugging "Invalid response value" or "Missing required parameter"

Skip when: building UI-only PHP (no remote callers) — use moodle-plugin-development.

File layout

<plugin>/
  db/services.php                                # function + service definitions
  classes/external/get_items.php                 # one file per external function
  classes/external/get_items_returns.php         # (optional) split returns
  lang/en/<component>.php                        # service descriptions

db/services.php

<?php
defined('MOODLE_INTERNAL') || die();

$functions = [
    'local_example_get_items' => [
        'classname'    => 'local_example\external\get_items',
        'methodname'   => 'execute',                // default: 'execute'
        'description'  => 'Return items in a course',
        'type'         => 'read',                   // 'read' or 'write'
        'ajax'         => true,                     // callable from core/ajax
        'capabilities' => 'local/example:view',     // checked in addition to per-method checks
        'services'     => [MOODLE_OFFICIAL_MOBILE_SERVICE], // expose to mobile
    ],
    'local_example_mark_present' => [
        'classname'    => 'local_example\external\mark_present',
        'description'  => 'Mark a user present',
        'type'         => 'write',
        'ajax'         => true,
        'capabilities' => 'local/example:mark',
    ],
];

$services = [
    'Example REST API' => [
        'functions'         => array_keys($functions),
        'restrictedusers'   => 1,        // require explicit user assignment
        'enabled'           => 1,
        'shortname'         => 'local_example_api',
        'downloadfiles'     => 1,
        'uploadfiles'       => 0,
    ],
];

Read the full file on GitHub · 284 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 284 lines · 50 tokens per session scan A 3082ffd5448d

Subscribe to this mod's changes

moodle-web-services is a skill published in the GitHub repository SaadRahman01/claude-moodle-dev (36 stars, last pushed 2mo ago), licensed MIT. It adds 50 tokens to every session and 2,411 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

cao-provider

Create a new CLI agent provider for CAO (CLI Agent Orchestrator). Use this skill whenever the user wants to add support for a new CLI-based AI agent (e.g., a new coding assistant CLI), integrate a new provider, or scaffold a provider implementation. Also use when the user asks about the provider architecture, what…

awslabs/cli-agent-orchestrator · 81 tokens

gemma4-local-deploy

A guide for running Gemma 4 12B, an AI language model, locally on a Mac or Apple Silicon computer. It uses downloaded model files and a local service that provides an OpenAI-compatible API or Ollama access when requested.

majiayu000/spellbook · 172 tokens

api-design

API contract design for REST and GraphQL, covering resource shape, URL and header versioning with deprecation windows, RFC 9457 Problem Details error handling, and OpenAPI specs. Use when specifying the wire contract an endpoint exposes, choosing a versioning scheme, or standardizing error response bodies across…

yonatangross/orchestkit · 76 tokens

architecture-decision-record

ADR templates in the Nygard format with context, decision, consequences, and alternatives. Use when writing ADRs, recording an architectural decision, or evaluating options.

yonatangross/orchestkit · 38 tokens

async-jobs

Async job processing patterns for background tasks, Celery workflows, task scheduling, retry strategies, and distributed task execution. Use when implementing background job processing, task queues, or scheduled task systems.

yonatangross/orchestkit · 42 tokens

database-patterns

Database design and migration patterns for Alembic migrations, schema design (SQL/NoSQL), and database versioning. Use when creating migrations, designing schemas, normalizing data, managing database versions, or handling schema drift.

yonatangross/orchestkit · 49 tokens