Skip to main content
Glama
boorich

MCP Human Loop Server

by boorich

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
NameRequiredDescriptionDefault
modelCapabilitiesNoList of model capabilities
taskDescriptionYesDescription of the task to be evaluated

Implementation Reference

  • 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) }] }; });
  • 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) }; }
  • 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"] } }] }));

Other Tools

Related 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/boorich/mcp-human-loop'

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