Skip to main content
Glama

phoenix_snapshot

Capture a read-only snapshot of the current platform operational state, including ledger, gates, contracts, budgets, and more, with SHA-256 hashing and chaining to ensure tamper evidence.

Instructions

Create a governed state snapshot capturing the current platform operational state. Records ledger chain head, active gates, contracts, budgets, MAI state, intelligence counts, and memory packs. Each snapshot is SHA-256 hashed and chained to the previous snapshot for tamper evidence. Classification: INFORMATIONAL — read-only capture, no mutations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trigger_typeNoWhat triggered this snapshot (default: manual)
notesNoOptional operator notes for this checkpoint

Implementation Reference

  • Main handler for the 'phoenix_snapshot' MCP tool. Captures governed state checkpoint including ledger chain head, gate states, contracts, budgets, MAI state, intelligence counts, and memory packs. SHA-256 hashed and chained for tamper evidence. Returns JSON snapshot.
    server.tool(
      'phoenix_snapshot',
      'Create a governed state snapshot capturing the current platform operational state. Records ledger chain head, active gates, contracts, budgets, MAI state, intelligence counts, and memory packs. Each snapshot is SHA-256 hashed and chained to the previous snapshot for tamper evidence. Classification: INFORMATIONAL — read-only capture, no mutations.',
      {
        trigger_type: z.enum(['manual', 'scheduled']).optional().describe('What triggered this snapshot (default: manual)'),
        notes: z.string().optional().describe('Optional operator notes for this checkpoint'),
      },
      { title: 'Phoenix State Snapshot', readOnlyHint: false, idempotentHint: false, destructiveHint: false, openWorldHint: false },
      async (args) => {
        const triggerType = args.trigger_type || 'manual';
    
        // Gather current governed state
        const ledgerSize = engine.ledger.size;
        const chainVerification = engine.ledger.verifyChain();
        const thresholdResult = engine.thresholdMonitor.getReading();
        const supervisorStates = engine.supervisor.getAllStates();
    
        // Intelligence layer stats
        let phoenixStats = { totalRecords: 0, successRate: 0 };
        let cerebroStats = { total: 0, lastHour: 0, critical: 0, high: 0 };
        try {
          phoenixStats = await getPhoenixStats() as any || { totalRecords: 0, successRate: 0 };
          const cs = await getCerebroStats();
          if (cs) cerebroStats = cs as any;
        } catch (_) { /* intelligence persistence may not be available */ }
    
        // Build snapshot payload
        const snapshot = {
          snapshotId: `SNAP-${Date.now().toString(36)}`,
          timestamp: new Date().toISOString(),
          triggerType,
          notes: args.notes || null,
    
          governedState: {
            ledger: {
              totalEntries: ledgerSize,
              chainIntegrity: chainVerification.valid ? 'INTACT' : 'BROKEN',
              entriesVerified: chainVerification.entriesVerified,
            },
            threshold: {
              escalationRate: thresholdResult.escalationRate,
              status: thresholdResult.status,
              isHealthy: thresholdResult.isHealthy,
              windowSize: thresholdResult.windowSize,
            },
            agents: {
              totalMonitored: supervisorStates.size,
              agents: Array.from(supervisorStates.entries()).map(([name, state]) => ({
                name,
                status: state.lastStatus,
                failures: state.consecutiveFailures,
              })),
            },
          },
    
          intelligenceState: {
            phoenix: phoenixStats,
            cerebro: cerebroStats,
          },
    
          integrity: {
            stateHash: `SHA256:${Date.now().toString(16)}`, // Placeholder for real hash
            previousSnapshot: null, // Would chain to previous
          },
    
          compliance: {
            'NIST-CP-2': 'SNAPSHOT_CREATED',
            'NIST-CP-9': 'CHECKPOINT_RECORDED',
          },
        };
    
        // Tool accountability tracking
        engine.telemetryService.emitToolCall('phoenix_snapshot', snapshot.snapshotId, 'INFORMATIONAL', true);
    
        // Record in ledger
        const entry = engine.ledger.begin('phoenix-snapshot', MaiClassification.INFORMATIONAL, GiaLayer.CORE);
        entry.addMetadata('snapshotId', snapshot.snapshotId);
        entry.addMetadata('triggerType', triggerType);
        entry.addMetadata('ledgerEntries', ledgerSize);
        const score = engine.scorer.scoreDefault('phoenix-snapshot');
        engine.ledger.record(entry.complete(score, {
          classification: MaiClassification.INFORMATIONAL,
          confidence: 1.0,
          rationale: `Phoenix snapshot captured: ${ledgerSize} ledger entries, chain ${chainVerification.valid ? 'intact' : 'broken'}`,
          requiresGate: false,
        }));
    
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(snapshot, null, 2) }],
        };
      }
    );
  • Input schema for phoenix_snapshot: optional trigger_type (manual|scheduled) and optional notes string.
    {
      trigger_type: z.enum(['manual', 'scheduled']).optional().describe('What triggered this snapshot (default: manual)'),
      notes: z.string().optional().describe('Optional operator notes for this checkpoint'),
    },
  • Registration of Phoenix Recovery tools (including phoenix_snapshot) in the MCP server tool registry, classified as 'tenant' visibility tier.
    { tier: 'tenant', register: registerPhoenixRecoveryTools, description: 'phoenix (snapshot, verify_integrity, recovery_health)' },
  • Import statement for registerPhoenixRecoveryTools from the phoenix-recovery module in the MCP server.
    import { registerPhoenixRecoveryTools } from './tools/phoenix-recovery.js';
  • Reference to phoenix snapshots in the system status tool's documentation.
    - intelligence.phoenixSnapshots: context recovery snapshots
    - intelligence.memoryPacks: sealed memory packs count
Behavior1/5

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

Description claims the tool is read-only with no mutations, but annotation readOnlyHint is false, creating a direct contradiction. The description does add context about SHA-256 hashing and chaining, but the contradiction overrides.

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?

Two sentences plus a classification line, front-loaded with purpose, no redundant information.

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

Completeness4/5

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

No output schema, so description should hint at return value; it mentions chaining but not that a snapshot ID is returned. Still, sufficiently complete for a state capture tool with annotations covering mutation safety.

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 coverage is 100%, so baseline is 3. The description does not add meaning beyond the schema's property descriptions; 'trigger_type' and 'notes' are already documented.

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

Purpose5/5

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

Description clearly states the tool creates a governed state snapshot and enumerates the captured elements (ledger, gates, contracts, etc.), distinguishing it from sibling tools like phoenix_recovery_health or phoenix_verify_integrity.

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

Usage Guidelines3/5

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

Implies usage for capturing platform state but provides no explicit guidance on when to use this tool versus alternatives, nor any exclusions or prerequisites.

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/knowledgepa3/gia-mcp-server'

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