Skip to main content
Glama
keyvalue.ts1.16 kB
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import type { MedplumClient } from './client'; import { ContentType } from './contenttype'; export class MedplumKeyValueClient { readonly medplum: MedplumClient; constructor(medplum: MedplumClient) { this.medplum = medplum; } /** * Gets the value for the given key from the keyvalue store. * @param key - The key to get the value for. * @returns The value for the given key. */ async get(key: string): Promise<string | undefined> { return this.medplum.get(`keyvalue/v1/${key}`); } /** * Sets the value for the given key in the keyvalue store. * @param key - The key to set the value for. * @param value - The value to set. */ async set(key: string, value: string): Promise<void> { await this.medplum.put(`keyvalue/v1/${key}`, value, ContentType.TEXT); } /** * Deletes the value for the given key from the keyvalue store. * @param key - The key to delete the value for. */ async delete(key: string): Promise<void> { await this.medplum.delete(`keyvalue/v1/${key}`); } }

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/medplum/medplum'

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