generate_exam
Create custom exams with up to 20 questions on any topic, specifying difficulty levels and question types for assessment preparation.
Instructions
Generate a full exam with up to 20 questions on any topic. Cost: $0.020 USDC. Service: examforge.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | ||
| num_questions | No | ||
| difficulty | No | ||
| question_types | No |
Implementation Reference
- src/index.ts:166-223 (handler)The tool is not defined as a static function in the codebase. This server is dynamic: it fetches tool definitions (including 'generate_exam' if it exists) from an external registry URL defined in `REGISTRY_URL`. The `CallToolRequestSchema` handler in `src/index.ts` dynamically routes execution by finding the matching tool in the registry and calling the associated endpoint.
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; let registry: Registry; try { registry = await fetchRegistry(); } catch (error) { return { content: [ { type: "text", text: JSON.stringify({ error: "Failed to fetch tool registry", detail: String(error) }), }, ], }; } const tool = registry.tools.find((t) => t.name === name); if (!tool) { return { content: [ { type: "text", text: JSON.stringify({ error: `Tool '${name}' not found`, available_tools: registry.tools.map((t) => t.name), }), }, ], }; } try { const result = await callTool(tool, args as Record<string, unknown>); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: JSON.stringify({ error: "Tool call failed", tool: name, service: tool.service, detail: String(error), }), }, ], }; } });