Skip to main content
Glama

evaluate_context_pack

Record evaluation outcomes for context packs, including scores, evidence, and guardrail compliance, to track performance and ensure quality standards.

Instructions

Record evaluation outcome for a context pack

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packIdYes
outcomeYes
signalNo
notesNo
rubricScoresNo
guardrailsNo

Implementation Reference

  • The core implementation of the evaluateContextPack function which handles evaluation logic, file writing, and provenance recording.
    function evaluateContextPack({ packId, outcome, signal = null, notes = '', rubricEvaluation = null }) {
      const evaluation = {
        id: `eval_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`,
        packId,
        outcome,
        signal,
        notes,
        rubricEvaluation,
        timestamp: nowIso(),
      };
    
      appendJsonl(path.join(CONTEXTFS_ROOT, NAMESPACES.provenance, 'evaluations.jsonl'), evaluation);
      recordProvenance({
        type: 'context_pack_evaluated',
        packId,
        outcome,
        signal,
        rubricPromotionEligible: rubricEvaluation ? rubricEvaluation.promotionEligible : null,
      });
    
      return evaluation;
    }
  • The adapter wrapper function (buildContextEvaluationResponse) that validates input and calls the core evaluateContextPack logic within the MCP server.
    function buildContextEvaluationResponse(args = {}) {
      if (!args.packId || !args.outcome) {
        throw new Error('packId and outcome are required');
      }
    
      let rubricEvaluation = null;
      if (args.rubricScores != null || args.guardrails != null) {
        rubricEvaluation = buildRubricEvaluation({
          rubricScores: args.rubricScores,
          guardrails: args.guardrails,
        });
      }
    
      const evaluation = evaluateContextPack({
        packId: args.packId,
        outcome: args.outcome,

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/IgorGanapolsky/mcp-memory-gateway'

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