Skip to main content
Glama

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),
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states 'generate' and 'signed', implying creation and authentication. It lacks details on permissions, side effects (e.g., storage, updates), rate limits, or what 'signed' entails. Minimal behavioral context is given.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 parameters with 0% schema coverage, no annotations, no output schema, and sibling tools suggesting complex domain (e.g., measurement, artifacts), the description is inadequate. It doesn't explain the tool's role in the broader system or what a 'receipt' entails, leaving significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain the meaning or usage of the 6 parameters (e.g., 'subject_content', 'drift_detected'), leaving them undocumented. Baseline would be lower without schema help.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action ('generate') and resource ('signed measurement receipt'), but lacks specificity about what a 'measurement receipt' is or how it differs from sibling tools like 'aga_measure_behavior' or 'aga_measure_subject'. It's clear but vague in domain context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes 'manually', which implies a context of manual vs. automated generation, but provides no explicit guidance on when to use this tool versus alternatives like 'aga_trigger_measurement' or 'aga_measure_behavior'. No exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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