Skip to main content
Glama
attestedintelligence

AGA-mcp-server

aga_measure_behavior

Measure behavioral patterns or record tool invocations for AI agents through attestation and logging to a tamper-evident continuity chain.

Instructions

Measure behavioral patterns or record tool invocation. (NIST-2025-0035)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tool_nameNoTool name to record/test
record_onlyNoIf true, just record without measuring

Implementation Reference

  • The handler function 'handleMeasureBehavior' for the tool 'aga_measure_behavior'. It records tool invocations and measures behavioral patterns using the behavioral monitor.
    export async function handleMeasureBehavior(args: MeasureBehaviorArgs, ctx: ServerContext) {
      // If a tool_name is provided, record the invocation first
      if (args.tool_name) {
        ctx.behavioralMonitor.recordInvocation(args.tool_name, sha256Str(args.tool_name));
      }
    
      // If record_only, just acknowledge the recording
      if (args.record_only) {
        return ctx.json({
          success: true,
          recorded: args.tool_name,
          record_only: true,
        });
      }
    
      // Measure behavioral patterns
      const measurement = ctx.behavioralMonitor.measure();
      if (measurement.drift_detected) {
        await ctx.appendToChain('BEHAVIORAL_DRIFT', {
          violations: measurement.violations,
          behavioral_hash: measurement.behavioral_hash,
        });
      }
      return ctx.json({
        success: true,
        ...measurement,
        violation_count: measurement.violations.length,
      });
    }
  • Argument interface for the 'aga_measure_behavior' tool.
    export interface MeasureBehaviorArgs {
      tool_name?: string;
      record_only?: boolean;
    }
  • src/server.ts:290-297 (registration)
    Registration of the 'aga_measure_behavior' tool in the MCP server.
    server.tool('aga_measure_behavior',
      'Measure behavioral patterns or record tool invocation. (NIST-2025-0035)',
      {
        tool_name: z.string().optional().describe('Tool name to record/test'),
        record_only: z.boolean().optional().describe('If true, just record without measuring'),
      },
      async (args) => handleMeasureBehavior(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