Skip to main content
Glama
attestedintelligence

AGA-mcp-server

aga_generate_receipt

Create signed measurement receipts for AI agent actions to document policy enforcement and maintain tamper-evident continuity logs.

Instructions

Generate a signed measurement receipt manually.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subject_contentNo
drift_detectedNo
drift_descriptionNo
measurement_typeNo
action_typeNo
action_detailNo

Implementation Reference

  • The handleGenerateReceipt function orchestrates the generation of a measurement receipt, updates the server context storage, and appends the interaction to the continuity chain.
    export async function handleGenerateReceipt(args: GenerateReceiptArgs, ctx: ServerContext) {
      if (!ctx.portal.artifact) return ctx.error('No artifact loaded.');
    
      const artRef = hashArtifact(ctx.portal.artifact);
      const mType = args.action_type ?? args.measurement_type ?? 'FILE_SYSTEM_STATE';
      const driftDesc = args.action_detail ?? args.drift_description ?? null;
    
      const receipt = generateReceipt({
        subjectId: ctx.portal.artifact.subject_identifier,
        artifactRef: artRef,
        currentHash: args.subject_content ?? artRef,
        sealedHash: ctx.portal.artifact.sealed_hash,
        driftDetected: args.drift_detected ?? false,
        driftDescription: driftDesc,
        action: null,
        measurementType: mType,
        seq: ctx.portal.sequenceCounter + 1,
        prevLeaf: ctx.portal.lastLeafHash,
        portalKP: ctx.portalKP,
      });
      await ctx.storage.storeReceipt(receipt);
      await ctx.appendToChain('INTERACTION_RECEIPT', {
        receipt_id: receipt.receipt_id,
        drift_detected: args.drift_detected ?? false,
        action_type: args.action_type,
        action_detail: args.action_detail,
      });
    
      return ctx.json({ success: true, receipt_id: receipt.receipt_id, receipt });
    }
  • Input schema definition for the aga_generate_receipt tool.
    export interface GenerateReceiptArgs {
      subject_content?: string;
      drift_detected?: boolean;
      drift_description?: string;
      measurement_type?: string;
      action_type?: string;
      action_detail?: string;
    }
  • src/server.ts:186-198 (registration)
    The aga_generate_receipt tool is registered in server.ts using the governedTool wrapper.
    // 9. aga_generate_receipt (governed)
    governedTool('aga_generate_receipt',
      'Generate a signed measurement receipt manually.',
      {
        subject_content: z.string().optional(),
        drift_detected: z.boolean().optional(),
        drift_description: z.string().optional(),
        measurement_type: z.string().optional(),
        action_type: z.string().optional(),
        action_detail: z.string().optional(),
      },
      async (args) => handleGenerateReceipt(args, ctx),
    );

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/attestedintelligence/aga-mcp-server'

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