Skip to main content
Glama

Add random questions

moodle_add_random_questions

Adds random-question slots to a Moodle quiz from a chosen question category so each student receives different questions.

Instructions

Adds N random-question slots drawing from a question category (each student gets different questions).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cmid": "<cmid>",
      "category_id": "<category_id>",
      "count": "<count>"
    },
    "name": "moodle_add_random_questions"
  }
}

Input Schema

NameRequiredDescriptionDefault
cmidYes
pageNo
countYes
courseidNoCourse whose bank holds the category (defaults to the quiz course)
category_idYes
include_subcategoriesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=true, so the safety profile is covered. The description usefully adds that each student receives different questions, which is real behavioral context, but it does not say how existing slots are affected, whether it requires edit permissions, or what happens if the category has fewer questions than requested.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler; the parenthetical clarifies the randomization behavior without adding redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a mutating quiz-structure tool with six parameters and very low schema coverage, and no output schema. The description omits the meaning of page, include_subcategories, and cmid, and does not mention ordering or where the new slots are inserted, leaving notable gaps for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 17% (just courseid), so the description must compensate and largely does not. It clarifies 'count' as N and ties the source to a question category, but leaves cmid, page, and include_subcategories entirely unexplained in both schema and description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource ('Adds N random-question slots') plus the key semantic that questions are drawn from a category, which implicitly separates it from moodle_add_questions_to_quiz. It does not name that sibling explicitly, so an agent must infer the distinction from the word 'random'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the tool is for populating a quiz with randomized question slots from a category. There is no statement of when to prefer this over moodle_add_questions_to_quiz, no prerequisites (e.g. category must already exist in the course bank), and no exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.