Skip to main content
Glama

generate_mcqs

Create multiple-choice questions for educational topics using EduChain's QnA engine. Specify a topic and number of questions to generate structured MCQs with correct answers and distractors.

Instructions

Generate multiple-choice questions (MCQs) for a given educational topic.

This function leverages EduChain's QnA engine to create well-structured
multiple-choice questions with correct answers and plausible distractors.
Each question includes four options with one correct answer.

Args:
    topic (str): The educational topic or subject area for which to generate
        questions. Should be specific enough to generate focused questions.
        Examples: "Photosynthesis", "World War II", "Python Programming"
    num_questions (int, optional): The number of questions to generate.
        Defaults to 5. Must be between 1 and 20.

Returns:
    Dict[str, Any]: A dictionary containing the generated questions and metadata.
        On success, includes:
        - questions: List of question objects with options and correct answers
        - topic: The input topic
        - count: Number of questions generated
        On error, includes:
        - error: Error message describing what went wrong

Raises:
    ValueError: If num_questions is not in the valid range (1-20)

Example:
    >>> generate_mcqs("Photosynthesis", 3)
    {
        "questions": [
            {
                "question": "What is the primary purpose of photosynthesis?",
                "options": ["A) ...", "B) ...", "C) ...", "D) ..."],
                "correct_answer": "B"
            },
            ...
        ],
        "topic": "Photosynthesis",
        "count": 3
    }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYes
num_questionsNo
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TAKSH-PAL/Educhain_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server