Skip to main content
Glama

entangle_secrets

Create quantum entanglement between two secrets so updating the source automatically syncs the target value.

Instructions

Create a quantum entanglement between two secrets. When the source is rotated/updated, the target automatically receives the same value.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceKeyYesSource secret key
targetKeyYesTarget secret key
sourceScopeNoScope: global or projectglobal
targetScopeNoScope: global or projectglobal
sourceProjectPathNo
targetProjectPathNo

Implementation Reference

  • The actual logic implementation for entangling secrets, which uses the internal `entangle` helper (aliased as `entangleLink`).
    export function entangleSecrets(
      sourceKey: string,
      sourceOpts: KeyringOptions,
      targetKey: string,
      targetOpts: KeyringOptions,
    ): void {
      const sourceScopes = resolveScope({ ...sourceOpts, scope: sourceOpts.scope ?? "global" });
      const targetScopes = resolveScope({ ...targetOpts, scope: targetOpts.scope ?? "global" });
    
      const source = { service: sourceScopes[0].service, key: sourceKey };
      const target = { service: targetScopes[0].service, key: targetKey };
    
      entangleLink(source, target);
      logAudit({
        action: "entangle",
        key: sourceKey,
        source: sourceOpts.source ?? "cli",
        detail: `entangled with ${targetKey}`,
      });
    }
  • Registration of the 'entangle_secrets' MCP tool and its parameter schema.
      "entangle_secrets",
      "Create a quantum entanglement between two secrets. When the source is rotated/updated, the target automatically receives the same value.",
      {
        sourceKey: z.string().describe("Source secret key"),
        targetKey: z.string().describe("Target secret key"),
        sourceScope: scopeSchema.default("global"),
        targetScope: scopeSchema.default("global"),
        sourceProjectPath: z.string().optional(),
        targetProjectPath: z.string().optional(),
      },
      async (params) => {
        entangleSecrets(
          params.sourceKey,
          {
            scope: params.sourceScope as Scope,
            projectPath: params.sourceProjectPath ?? process.cwd(),
            source: "mcp",
          },
          params.targetKey,
          {
            scope: params.targetScope as Scope,
            projectPath: params.targetProjectPath ?? process.cwd(),
            source: "mcp",
          },
        );
    
        return text(`Entangled: ${params.sourceKey} <-> ${params.targetKey}`);
      },
    );

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/I4cTime/quantum_ring'

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