Skip to main content
Glama
CWNApps

TrustAtom MCP Server

by CWNApps

create_trustatom

Generate cryptographic receipts for AI decisions to enable compliance auditing and verification. Signs actions with Ed25519 encryption and maps to regulatory frameworks like HIPAA and SOX.

Instructions

Sign an AI decision and return a cryptographic receipt. Every AI decision that matters should have a receipt. Signing takes <3ms. Receipt is Ed25519-signed + SHA-256-hashed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe action being decided (e.g., APPROVE_LOAN, TRIAGE_PATIENT, DEPLOY, TRADE_SIGNAL)
actorYesThe AI agent or system making the decision
decisionYesThe decision outcome
contextNoAdditional context for the decision (risk factors, confidence scores, etc.)
compliance_tagsNoCompliance framework tags (e.g., HIPAA, SOX, NIST:PR, SOC2:CC6.1)
risk_scoreNoRisk score 0.0-1.0 (auto-computed if not provided)

Implementation Reference

  • The MCP tool request handler for 'create_trustatom' in src/server.ts, which delegates the logic to the 'createTrustAtom' function.
    case "create_trustatom": {
      const input: TrustAtomInput = {
        action: String(args?.action ?? "UNKNOWN"),
        actor: String(args?.actor ?? "unknown-agent"),
        decision: (args?.decision as "ALLOW" | "DENY") ?? "DENY",
        context: (args?.context as Record<string, unknown>) ?? {},
        compliance_tags: args?.compliance_tags as string[] | undefined,
        risk_score: args?.risk_score as number | undefined,
      };
    
      const receipt = createTrustAtom(input, keyPair);
  • The core implementation logic for generating a TrustAtom cryptographic receipt in src/sign.ts.
    export function createTrustAtom(
      input: TrustAtomInput,
      keyPair: KeyPair,
    ): TrustAtomReceipt {
      const start = performance.now();
      const ts = Date.now();
    
      // Canonical JSON (sorted keys, no whitespace) — matches Python implementation
      const canonical = JSON.stringify(input, Object.keys(input).sort());
      const evidenceHash = createHash("sha256").update(canonical).digest("hex");
    
      // Ed25519 sign the evidence hash
      const sig = nacl.sign.detached(
        naclUtil.decodeUTF8(evidenceHash),
        keyPair.secretKey,
      );
      const sigB64 = naclUtil.encodeBase64(sig);
      const pubB64 = naclUtil.encodeBase64(keyPair.publicKey);
    
      // Compute risk + compliance from action
      const risk = input.risk_score ?? RISK_MAP[input.action] ?? 0.5;
      const tags =
        input.compliance_tags ?? COMPLIANCE_MAP[input.action] ?? ["NIST:PR"];
    
      const signingTime = performance.now() - start;
    
      return {
        id: `ta_${evidenceHash.slice(0, 12)}`,
        action: input.action,
        actor: input.actor,
        decision: input.decision,
        context: input.context,
        evidence_hash: evidenceHash,
        signature_b64: sigB64,
        public_key_b64: pubB64,
        timestamp_iso: new Date(ts).toISOString(),
        timestamp_ms: ts,
        dct: {
          env: "SANDBOX",
          compliance_tags: tags,
          risk_score: risk,
          ttl_ms: 0,
        },
        tenant_id: input.tenant_id ?? "demo-tenant",
        resource_id: input.resource_id ?? "default",
        signing_time_ms: Math.round(signingTime * 100) / 100,
      };
    }
  • The MCP tool definition (schema) for 'create_trustatom' in src/server.ts.
    {
      name: "create_trustatom",
      description:
        "Sign an AI decision and return a cryptographic receipt. " +
        "Every AI decision that matters should have a receipt. " +
        "Signing takes <3ms. Receipt is Ed25519-signed + SHA-256-hashed.",
      inputSchema: {
        type: "object" as const,
        properties: {
          action: {
            type: "string",
            description:
              "The action being decided (e.g., APPROVE_LOAN, TRIAGE_PATIENT, DEPLOY, TRADE_SIGNAL)",
          },
          actor: {
            type: "string",
            description: "The AI agent or system making the decision",
          },
          decision: {
            type: "string",
            enum: ["ALLOW", "DENY"],
            description: "The decision outcome",
          },
          context: {
            type: "object",
            description:
              "Additional context for the decision (risk factors, confidence scores, etc.)",
          },
          compliance_tags: {
            type: "array",
            items: { type: "string" },
            description:
              "Compliance framework tags (e.g., HIPAA, SOX, NIST:PR, SOC2:CC6.1)",
          },
          risk_score: {
            type: "number",
            description: "Risk score 0.0-1.0 (auto-computed if not provided)",
          },
        },
        required: ["action", "actor", "decision"],
      },
    },
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context about performance ('Signing takes <3ms'), cryptographic details ('Ed25519-signed + SHA-256-hashed'), and the auto-computation feature for risk_score. However, it doesn't cover error conditions, authentication requirements, rate limits, or what happens if the signing fails.

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 efficiently structured with three sentences: purpose statement, importance rationale, and technical/performance details. Every sentence adds value without redundancy, and it's front-loaded with the core function.

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

Completeness3/5

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

Given the tool's complexity (6 parameters, cryptographic operations) and lack of annotations/output schema, the description is moderately complete. It covers the purpose, importance, and some behavioral traits but lacks details on error handling, response format, or integration constraints that would help an agent use it correctly in varied scenarios.

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 documents all parameters thoroughly. The description doesn't add any parameter-specific semantics beyond what's in the schema (e.g., it doesn't explain format examples for 'action' or 'context' beyond the schema's descriptions). Baseline 3 is appropriate when the schema does the heavy lifting.

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?

The description clearly states the tool's purpose with specific verbs ('sign an AI decision', 'return a cryptographic receipt') and distinguishes it from siblings by focusing on creation/signing rather than retrieval (get_compliance_report, query_receipts) or verification (verify_trustatom). It also explains why this matters ('Every AI decision that matters should have a receipt').

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

Usage Guidelines4/5

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

The description provides clear context about when to use this tool ('Every AI decision that matters should have a receipt') and implies usage for creating signed records of decisions. However, it doesn't explicitly contrast with alternatives like query_receipts for retrieval or verify_trustatom for verification, nor does it specify 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/CWNApps/trustatom-mcp'

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