Skip to main content
Glama

Import questions (GIFT / XML / Aiken)

moodle_import_questions

Import questions from GIFT, Moodle XML, Aiken, missing-word, or Cloze text into a Moodle question category and return the new question IDs.

Instructions

Imports questions from text in GIFT, Moodle XML, Aiken, missing-word or Cloze (multianswer) format into a category. Supports every question type. Returns the new question ids.

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": {
      "category_id": "<category_id>",
      "format": "<format>",
      "content": "<content>"
    },
    "name": "moodle_import_questions"
  }
}

Input Schema

NameRequiredDescriptionDefault
cmidNoQuiz cmid: use the quiz's own question bank instead of the course one
formatYes
contentYes
courseidNoCourse id: use the course question bank
category_idYes
matchgradesNoHow to handle grades not in Moodle list (default nearest)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false and destructiveHint=false, which the 'Imports' wording is consistent with. The description adds two useful facts beyond annotations: that all question types are supported and that the new question ids are returned. It omits prerequisites (does the category need to exist?) and duplicate-handling behavior.

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?

Three short sentences, front-loaded with the action and destination, with no restatement of the name or padding. Every clause either scopes the operation or discloses a return value.

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

Completeness4/5

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

For a 6-parameter mutation tool with no output schema, the description covers formats, target, capability breadth, and return value. The remaining gap is how the three location parameters interact, which is a meaningful but not fatal omission.

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

Parameters3/5

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

Schema coverage is 50%, and the description lists the five formats, matching the format enum, plus 'into a category' for category_id. It leaves the cmid vs courseid vs category_id scoping choice and matchgrades' error-vs-nearest behavior unexplained, so it only partially compensates for the coverage gap.

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?

Names a specific verb (Imports) and resource (questions), plus the accepted formats and the destination (a category). It is clear enough to separate from moodle_create_questions, though it never names the sibling explicitly.

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: bulk-loading questions from a text payload rather than creating them one by one. There is no explicit when-to-use, no exclusions, and no pointer to alternatives such as moodle_create_questions or moodle_add_questions_to_quiz.

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