get_weak_areas
Find which task statements have accuracy below 70% to prioritize your study on weak areas.
Instructions
Identify your weakest task statements based on accuracy below 70%. Focus your study on these areas.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/get-weak-areas.ts:8-37 (handler)The main tool handler that registers 'get_weak_areas' with the MCP server. It calls getWeakAreas from the database, formats the results with domain/statement names from the curriculum, and returns a formatted text response. If no weak areas exist, it returns a message saying so.
export function registerGetWeakAreas(server: McpServer, db: Database.Database, userConfig: UserConfig): void { server.tool( 'get_weak_areas', 'Identify your weakest task statements based on accuracy below 70%. Focus your study on these areas.', {}, async () => { const userId = userConfig.userId; ensureUser(db, userId); const curriculum = loadCurriculum(); const weakAreas = getWeakAreas(db, userId); if (weakAreas.length === 0) { return { content: [{ type: 'text' as const, text: 'No weak areas identified yet. Complete some questions first or all areas are above 70%!' }], }; } const lines = ['═══ WEAK AREAS ═══', '']; for (const area of weakAreas) { const domain = curriculum.domains.find(d => d.id === area.domainId); const ts = domain?.taskStatements.find(t => t.id === area.taskStatement); lines.push(` ${area.taskStatement}: ${ts?.title ?? 'Unknown'}`); lines.push(` Accuracy: ${area.accuracyPercent}% (${area.correctAttempts}/${area.totalAttempts})`); lines.push(` Mastery: ${area.masteryLevel}`); lines.push(''); } return { content: [{ type: 'text' as const, text: lines.join('\n') }] }; } ); } - src/db/mastery.ts:12-14 (helper)Database helper function that queries domain_mastery for rows with accuracyPercent below a threshold (default 70) and totalAttempts > 0, ordered ascending by accuracy.
export function getWeakAreas(db: Database.Database, userId: string, threshold: number = 70): readonly DomainMastery[] { return db.prepare('SELECT * FROM domain_mastery WHERE userId = ? AND accuracyPercent < ? AND totalAttempts > 0 ORDER BY accuracyPercent ASC').all(userId, threshold) as DomainMastery[]; } - src/tools/index.ts:23-42 (registration)Central registration point that calls registerGetWeakAreas(server, db, userConfig) at line 30 to wire up the tool.
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); registerStartAssessment(server, db, userConfig); registerGetWeakAreas(server, db, userConfig); registerGetStudyPlan(server, db, userConfig); registerScaffoldProject(server, db, userConfig); registerResetProgress(server, db, userConfig); registerStartPracticeExam(server, db, userConfig); registerSubmitExamAnswer(server, db, userConfig); registerGetExamHistory(server, db, userConfig); registerFollowUp(server, db, userConfig); registerStartCapstoneBuild(server, db, userConfig); registerCapstoneBuildStep(server, db, userConfig); registerCapstoneBuildStatus(server, db, userConfig); registerDashboard(server, db, userConfig); } - src/tools/get-weak-areas.ts:12-12 (schema)The tool has an empty schema object {} (no input parameters required), with the description: 'Identify your weakest task statements based on accuracy below 70%. Focus your study on these areas.'
{},