Skip to main content
Glama
Connectry-io

Connectry Architect Cert

Official

get_practice_question

Retrieves the next practice question, prioritizing review and weak areas to target learning gaps for certification exam preparation.

Instructions

Get the next practice question. Prioritizes review questions, then weak areas, then new material.

IMPORTANT — present the question using AskUserQuestion:

  • header: "Answer"

  • question: Include the FULL scenario text AND question text from the response

  • options: 4 items with label "A"/"B"/"C"/"D" and description as the option text

  • If the scenario contains code, add a "preview" field on each option showing the code snippet Then call submit_answer with the questionId and selected answer. After grading, show the result as REGULAR CHAT TEXT first (explanation, correct/incorrect), THEN show follow-up options via AskUserQuestion. Explanations must be readable in the main chat, not hidden behind cards.

EDGE CASES:

  • "Other": Answer the user's question, then re-present the SAME question via AskUserQuestion.

  • "Skip": Call get_practice_question again for a new question. Never break the flow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainIdNoOptional domain ID to filter questions (1-5)
difficultyNoOptional difficulty filter

Implementation Reference

  • The main handler function `registerGetPracticeQuestion` that registers the 'get_practice_question' tool with the MCP server. It handles question selection logic: loads questions, filters by optional domainId/difficulty, prioritizes overdue reviews then weak areas then new material, formats the question text, elicits a single-select answer, and returns the result along with metadata for the quiz UI widget.
    export function registerGetPracticeQuestion(server: McpServer, db: Database.Database, userConfig: UserConfig): void {
      server.tool(
        'get_practice_question',
        `Get the next practice question. Prioritizes review questions, then weak areas, then new material.
    
    IMPORTANT — present the question using AskUserQuestion:
    - header: "Answer"
    - question: Include the FULL scenario text AND question text from the response
    - options: 4 items with label "A"/"B"/"C"/"D" and description as the option text
    - If the scenario contains code, add a "preview" field on each option showing the code snippet
    Then call submit_answer with the questionId and selected answer. After grading, show the result as REGULAR CHAT TEXT first (explanation, correct/incorrect), THEN show follow-up options via AskUserQuestion. Explanations must be readable in the main chat, not hidden behind cards.
    
    EDGE CASES:
    - "Other": Answer the user's question, then re-present the SAME question via AskUserQuestion.
    - "Skip": Call get_practice_question again for a new question. Never break the flow.`,
        {
          domainId: z.number().optional().describe('Optional domain ID to filter questions (1-5)'),
          difficulty: z.enum(['easy', 'medium', 'hard']).optional().describe('Optional difficulty filter'),
        },
        async ({ domainId, difficulty }) => {
          const userId = userConfig.userId;
          ensureUser(db, userId);
          const answeredIds = getAnsweredQuestionIds(db, userId);
          const overdueReviews = getOverdueReviews(db, userId);
          const weakAreas = getWeakAreas(db, userId);
          let questions = loadQuestions(domainId);
          if (difficulty) {
            questions = questions.filter(q => q.difficulty === difficulty);
          }
          const question = selectNextQuestion(questions, overdueReviews, weakAreas, answeredIds);
          if (!question) {
            return {
              content: [{ type: 'text' as const, text: 'No more questions available for the selected criteria. Try a different domain or difficulty.' }],
            };
          }
    
          const questionText = formatQuestionText(question);
    
          const elicitOptions = OPTION_KEYS.map(key => ({
            value: key,
            title: `${key}. ${question.options[key]}`,
          }));
    
          const selectedAnswer = await elicitSingleSelect(
            server,
            questionText,
            'answer',
            elicitOptions,
          );
    
          if (selectedAnswer) {
            const responseText = [
              questionText,
              '',
              '---',
              '',
              `**Selected answer: ${selectedAnswer}**`,
              '',
              `Use submit_answer with questionId "${question.id}" and answer "${selectedAnswer}" to grade this response.`,
            ].join('\n');
    
            return {
              content: [{ type: 'text' as const, text: responseText }],
              _meta: buildQuizMeta(),
            };
          }
    
          const fallbackText = [
            questionText,
            '',
            '---',
            '',
            `Question ID: ${question.id}`,
            '',
            'Use submit_answer with the question ID and your chosen answer (A, B, C, or D) to check your response.',
          ].join('\n');
    
          return {
            content: [{ type: 'text' as const, text: fallbackText }],
            _meta: buildQuizMeta(),
          };
        }
      );
    }
  • The `formatQuestionText` helper function that formats question data (id, domain, difficulty, task statement, scenario, text, and options A-D) into a nicely formatted Markdown string for display.
    const OPTION_KEYS = ['A', 'B', 'C', 'D'] as const;
    
    function formatQuestionText(question: {
      readonly id: string;
      readonly taskStatement: string;
      readonly domainId: number;
      readonly difficulty: string;
      readonly scenario: string;
      readonly text: string;
      readonly options: { readonly A: string; readonly B: string; readonly C: string; readonly D: string };
    }): string {
      const lines = [
        `**Question ${question.id}** (Domain ${question.domainId} | ${question.difficulty})`,
        '',
        `**Task:** ${question.taskStatement}`,
        '',
        '---',
        '',
        question.scenario,
        '',
        `**${question.text}**`,
        '',
        ...OPTION_KEYS.map(key => `  **${key}.** ${question.options[key]}`),
      ];
      return lines.join('\n');
    }
  • Input schema for the tool: optional `domainId` (number, 1-5) and optional `difficulty` (enum: 'easy', 'medium', 'hard'), validated with Zod.
    {
      domainId: z.number().optional().describe('Optional domain ID to filter questions (1-5)'),
      difficulty: z.enum(['easy', 'medium', 'hard']).optional().describe('Optional difficulty filter'),
    },
  • Registration of the `registerGetPracticeQuestion` function: imported from './get-practice-question.js' (line 8) and called in the `registerTools` function (line 28) alongside all other tool registrations.
    import { registerGetPracticeQuestion } from './get-practice-question.js';
    import { registerStartAssessment } from './start-assessment.js';
    import { registerGetWeakAreas } from './get-weak-areas.js';
    import { registerGetStudyPlan } from './get-study-plan.js';
    import { registerScaffoldProject } from './scaffold-project.js';
    import { registerResetProgress } from './reset-progress.js';
    import { registerStartPracticeExam } from './start-practice-exam.js';
    import { registerSubmitExamAnswer } from './submit-exam-answer.js';
    import { registerGetExamHistory } from './get-exam-history.js';
    import { registerFollowUp } from './follow-up.js';
    import { registerStartCapstoneBuild } from './start-capstone-build.js';
    import { registerCapstoneBuildStep } from './capstone-build-step.js';
    import { registerCapstoneBuildStatus } from './capstone-build-status.js';
    import { registerDashboard } from './dashboard.js';
    
    export function registerTools(server: McpServer, db: Database.Database, userConfig: UserConfig): void {
      registerSubmitAnswer(server, db, userConfig);
      registerGetProgress(server, db, userConfig);
      registerGetCurriculum(server, db, userConfig);
      registerGetSectionDetails(server, db, userConfig);
      registerGetPracticeQuestion(server, db, userConfig);
  • The `selectNextQuestion` helper used by the tool handler to pick the next question. Prioritizes: (1) overdue reviews sorted by ease factor, (2) weak areas, (3) any unanswered question. Delegates to `findUnansweredForTaskStatement` for matching.
    import type { Question, ReviewScheduleEntry, DomainMastery } from '../types.js';
    
    export function selectNextQuestion(
      allQuestions: readonly Question[], overdueReviews: readonly ReviewScheduleEntry[],
      weakAreas: readonly DomainMastery[], answeredQuestionIds: ReadonlySet<string>,
    ): Question | undefined {
      if (overdueReviews.length > 0) {
        const weakestFirst = [...overdueReviews].sort((a, b) => a.easeFactor - b.easeFactor);
        for (const review of weakestFirst) {
          const question = findUnansweredForTaskStatement(allQuestions, review.taskStatement, answeredQuestionIds);
          if (question) return question;
        }
      }
      if (weakAreas.length > 0) {
        for (const area of weakAreas) {
          const question = findUnansweredForTaskStatement(allQuestions, area.taskStatement, answeredQuestionIds);
          if (question) return question;
        }
      }
      return allQuestions.find((q) => !answeredQuestionIds.has(q.id));
    }
    
    function findUnansweredForTaskStatement(
      questions: readonly Question[], taskStatement: string, answeredIds: ReadonlySet<string>,
    ): Question | undefined {
      return questions.find((q) => q.taskStatement === taskStatement && !answeredIds.has(q.id));
    }
Behavior3/5

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

With no annotations provided, the description bears full burden. It explains the prioritization logic and flow but does not disclose side effects (e.g., marking questions as seen, state changes) or permissions required. The emphasis is on usage rather than behavioral safety.

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

Conciseness3/5

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

The description is lengthy and mixes purpose, usage instructions, and edge cases into a single block. While front-loaded with the core purpose, it could be more concise by separating general functionality from detailed agent instructions.

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?

Given the complexity of the multi-step interaction and absence of an output schema, the description adequately explains the expected output (question details for AskUserQuestion) and edge cases. It assumes some agent knowledge of sibling tools but is largely comprehensive.

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?

The input schema has 100% description coverage for both parameters (domainId and difficulty). The description adds no extra meaning beyond what the schema already provides, so baseline of 3 is appropriate.

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 retrieves the next practice question with explicit prioritization (review, weak areas, new material). This distinguishes it from siblings like submit_answer or follow_up, which serve different roles in the workflow.

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

Usage Guidelines4/5

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

The description provides detailed instructions on how to present the question and handle edge cases (Other, Skip). However, it does not explicitly mention when not to use this tool or compare to alternatives like get_exam_history or get_curriculum, missing some usage boundaries.

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/Connectry-io/connectrylab-architect-cert-mcp'

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