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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it uses 'EduChain's QnA engine', generates 'well-structured' questions with 'four options and one correct answer', includes error handling with error messages, and specifies the ValueError exception for parameter validation. However, it doesn't mention rate limits, authentication requirements, or potential side effects.

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

Conciseness4/5

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

The description is well-structured with clear sections (purpose, parameters, returns, raises, example) and front-loaded with the core functionality. While comprehensive, some sentences could be more concise (e.g., the returns section is somewhat verbose). Overall, most content earns its place by adding value.

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

Completeness5/5

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

Given the tool's moderate complexity, no annotations, and the presence of an output schema, the description is complete enough. It thoroughly explains parameters, return structure (including success/error cases), exceptions, and provides a concrete example. The output schema means the description doesn't need to detail return values beyond what's provided.

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

Parameters5/5

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

The description adds substantial meaning beyond the input schema, which has 0% description coverage. It provides detailed explanations for both parameters: 'topic' includes purpose, specificity guidance, and concrete examples; 'num_questions' explains default value, valid range, and constraints. This fully compensates for the schema's lack of descriptions.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verb ('generate') and resource ('multiple-choice questions'), and distinguishes it from sibling tools by specifying the type of educational content (MCQs vs flashcards or lesson plans). The opening sentence directly answers what the tool does.

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?

The description implies usage context through the 'educational topic' specification and parameter examples, but doesn't explicitly state when to use this tool versus the sibling tools (generate_flashcards, lesson_plan). No guidance is provided about alternative scenarios or exclusions.

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

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