get_progress
Check current MBTI test progress by providing session state, showing answered questions and remaining items in personality assessment.
Instructions
查询当前测试进度。需要传入测试会话状态。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session | Yes | 测试会话状态 |
Implementation Reference
- src/index.ts:78-97 (registration)Registration of the 'get_progress' tool in the ListTools handler, defining its name, description, and input schema.{ name: 'get_progress', description: '查询当前测试进度。需要传入测试会话状态。', inputSchema: { type: 'object', properties: { session: { type: 'object', description: '测试会话状态', properties: { testType: { type: 'string' }, answers: { type: 'array' }, currentQuestionIndex: { type: 'number' }, }, required: ['testType', 'answers', 'currentQuestionIndex'], }, }, required: ['session'], }, },
- src/index.ts:81-96 (schema)Input schema for the 'get_progress' tool, validating the session object.inputSchema: { type: 'object', properties: { session: { type: 'object', description: '测试会话状态', properties: { testType: { type: 'string' }, answers: { type: 'array' }, currentQuestionIndex: { type: 'number' }, }, required: ['testType', 'answers', 'currentQuestionIndex'], }, }, required: ['session'], },
- src/index.ts:232-254 (handler)Handler implementation for the 'get_progress' tool. Computes progress percentage and completion status based on the provided session state and question bank total.if (name === 'get_progress') { const session = args.session as TestSession; const questions = session.testType === 'simplified' ? questionBank.simplified : questionBank.cognitive; return { content: [ { type: 'text', text: JSON.stringify({ testType: session.testType, progress: { answered: session.answers.length, total: questions.length, percentage: Math.round((session.answers.length / questions.length) * 100), }, completed: session.answers.length >= questions.length, }, null, 2), }, ], }; }