evaluate_need_for_human
Determine if a task requires human intervention by analyzing task descriptions and model capabilities, ensuring optimal workflow between AI and human input.
Instructions
Evaluate if a task requires human intervention
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| modelCapabilities | No | List of model capabilities | |
| taskDescription | Yes | Description of the task to be evaluated |
Implementation Reference
- src/index.ts:48-66 (handler)MCP CallToolRequest handler for the 'evaluate_need_for_human' tool. Validates tool name, extracts input arguments, invokes TaskEvaluator, and returns the result as JSON text content.server.setRequestHandler(CallToolRequestSchema, async (request) => { if (request.params.name !== "evaluate_need_for_human") { throw new Error("Unknown tool"); } const taskDescription = String(request.params.arguments?.taskDescription); const modelCapabilities = Array.isArray(request.params.arguments?.modelCapabilities) ? request.params.arguments?.modelCapabilities : []; const evaluation = TaskEvaluator.evaluateTask(taskDescription, modelCapabilities); return { content: [{ type: "text", text: JSON.stringify(evaluation, null, 2) }] }; });
- src/evaluator.ts:39-52 (handler)Core tool logic implementation. Orchestrates evaluation by calculating task factors, determining human need, confidence, reason, suggested action, statements, and questions.static evaluateTask(taskDescription: string, modelCapabilities: string[] = []): EvaluationResult { const factors = this.calculateFactors(taskDescription, modelCapabilities); const needsHuman = this.determineHumanNeed(factors); const confidence = this.calculateConfidence(factors); return { needsHuman, confidence, reason: this.generateReason(factors, needsHuman), suggestedAction: this.determineSuggestedAction(factors, needsHuman), confidentStatements: this.generateConfidentStatements(taskDescription, factors, needsHuman), humanQuestions: this.generateHumanQuestions(factors, needsHuman) }; }
- src/index.ts:30-44 (schema)Input schema definition for the 'evaluate_need_for_human' tool, specifying taskDescription as required and modelCapabilities as optional array of strings.inputSchema: { type: "object", properties: { taskDescription: { type: "string", description: "Description of the task to be evaluated" }, modelCapabilities: { type: "array", items: { type: "string" }, description: "List of model capabilities" } }, required: ["taskDescription"] }
- src/index.ts:26-46 (registration)Registers the 'evaluate_need_for_human' tool in the ListToolsRequest handler, providing name, description, and full input schema.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [{ name: "evaluate_need_for_human", description: "Evaluate if a task requires human intervention", inputSchema: { type: "object", properties: { taskDescription: { type: "string", description: "Description of the task to be evaluated" }, modelCapabilities: { type: "array", items: { type: "string" }, description: "List of model capabilities" } }, required: ["taskDescription"] } }] }));