Skip to main content
Glama

has_secret

Check if a secret exists in the quantum-inspired vault without revealing its value. Returns true for valid secrets, false for missing or expired ones.

Instructions

Check if a secret exists. Returns boolean. Never reveals the value. Respects decay — expired secrets return false.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesThe secret key name
scopeNoScope: global or project
projectPathNoProject root path for project-scoped secrets

Implementation Reference

  • The implementation of hasSecret checks if a secret exists and is not expired across the resolved scopes.
    export function hasSecret(
      key: string,
      opts: KeyringOptions = {},
    ): boolean {
      const scopes = resolveScope(opts);
    
      for (const { service } of scopes) {
        const envelope = readEnvelope(service, key);
        if (envelope) {
          const decay = checkDecay(envelope);
          if (!decay.isExpired) return true;
        }
      }
    
      return false;
    }

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