Skip to main content
Glama

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

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It mentions 'measure' and 'record' functions but doesn't explain what behavioral patterns are measured, how recording works, whether this is a read-only or mutating operation, what permissions are required, or what the output looks like. The NIST reference hints at compliance/security context but doesn't provide actionable behavioral details.

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

Conciseness4/5

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

The description is appropriately concise with just one sentence plus a reference. It's front-loaded with the core functionality. However, the NIST reference feels somewhat tacked on without explanation, and the description could be more efficiently structured to separate purpose from context.

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?

For a tool with 2 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what 'behavioral patterns' means, what gets measured versus recorded, what the tool actually returns, or how it differs from similar measurement tools in the sibling set. The NIST reference provides some context but doesn't compensate for the missing operational details.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already fully documents both parameters. The description doesn't add any meaningful semantic context beyond what's in the schema descriptions - it doesn't explain how 'tool_name' relates to behavioral measurement, what 'record_only' actually means in practice, or provide examples of usage patterns. Baseline 3 is appropriate when schema does all the work.

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 tool's purpose as 'Measure behavioral patterns or record tool invocation', which provides a general verb+action combination. However, it's vague about what specifically is being measured or recorded, and it doesn't distinguish this tool from siblings like 'aga_measure_subject' or 'aga_trigger_measurement' that might have overlapping measurement functions. The NIST reference adds context but doesn't clarify the specific scope.

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 provides no guidance on when to use this tool versus alternatives. With siblings like 'aga_measure_subject', 'aga_trigger_measurement', and 'aga_record_behavior' (implied by 'record' function), there's clear potential for overlap, but the description offers no explicit when/when-not instructions or named alternatives. The agent must infer usage from the tool name and parameters alone.

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