Skip to main content
Glama

list_secrets

List all secret keys with quantum metadata like scope, decay status, and entanglement details while keeping values secure. Use to manage API keys anchored to your OS vault without exposing plaintext data.

Instructions

List all secret keys with quantum metadata (scope, decay status, superposition states, entanglement, access count). Values are never exposed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNoScope: global or project
projectPathNoProject root path for project-scoped secrets

Implementation Reference

  • The core implementation of the listSecrets function which aggregates secrets from different keyring services.
    export function listSecrets(opts: KeyringOptions = {}): SecretEntry[] {
      const source = opts.source ?? "cli";
      const services: { service: string; scope: Scope }[] = [];
    
      if (!opts.scope || opts.scope === "global") {
        services.push({ service: globalService(), scope: "global" });
      }
    
      if ((!opts.scope || opts.scope === "project") && opts.projectPath) {
        services.push({
          service: projectService(opts.projectPath),
          scope: "project",
        });
      }
    
      const results: SecretEntry[] = [];
      const seen = new Set<string>();
    
      for (const { service, scope } of services) {
        try {
          const credentials = findCredentials(service);
          for (const cred of credentials) {
            const id = `${scope}:${cred.account}`;
            if (seen.has(id)) continue;
            seen.add(id);
    
            const envelope = parseEnvelope(cred.password) ?? wrapLegacy(cred.password);
            const decay = checkDecay(envelope);
    
            results.push({
              key: cred.account,
              scope,
              envelope,
              decay,
            });
          }
        } catch {
          // keyring unavailable
        }
      }
    
      logAudit({ action: "list", source });
    
      return results.sort((a, b) => a.key.localeCompare(b.key));
    }
  • Registration of the "list_secrets" MCP tool, which invokes the core implementation.
    server.tool(
      "list_secrets",
      "List all secret keys with quantum metadata (scope, decay status, superposition states, entanglement, access count). Values are never exposed.",
      {
        scope: scopeSchema,
        projectPath: projectPathSchema,
      },
      async (params) => {
        const entries = listSecrets(opts(params));
        if (entries.length === 0) return text("No secrets found");
    
        const lines = entries.map((e) => {
          const parts = [`[${e.scope}] ${e.key}`];
    
          if (e.envelope?.states) {
            parts.push(`states:[${Object.keys(e.envelope.states).join(",")}]`);
          }
          if (e.decay?.isExpired) {
            parts.push("EXPIRED");
          } else if (e.decay?.isStale) {
            parts.push(`stale(${e.decay.lifetimePercent}%)`);
          }
          if (e.decay?.timeRemaining && !e.decay.isExpired) {
            parts.push(`ttl:${e.decay.timeRemaining}`);
          }
          if (e.envelope?.meta.entangled?.length) {
            parts.push(`entangled:${e.envelope.meta.entangled.length}`);
          }
          if (e.envelope && e.envelope.meta.accessCount > 0) {
            parts.push(`reads:${e.envelope.meta.accessCount}`);
          }
    
          return parts.join(" | ");
        });
    
        return text(lines.join("\n"));
      },
    );

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