Skip to main content
Glama
hteek

Serverless MCP

by hteek
entity.ts823 B
import { Model, OneSchema, Table } from 'dynamodb-onetable'; import { getDynamoDBFromContext, MiddlewareContext } from '#middleware'; export type ModelName = string | number | symbol; export type RequiredProperty<T> = { [P in keyof T]: Required<NonNullable<T[P]>>; }; export abstract class BaseEntity { static readonly expiresInDays = (days?: number) => Math.floor((Date.now() + (days ?? 30) * 24 * 60 * 60 * 1000) / 1000); static readonly getTable: ( context: MiddlewareContext, schema: OneSchema ) => Table = (context, schema) => getDynamoDBFromContext(context).getTable(schema); static readonly getModel = <T>( context: MiddlewareContext, schema: OneSchema, name: T extends ModelName ? T : ModelName ) => BaseEntity.getTable(context, schema).getModel<T>(name) as Model<T>; }

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/hteek/serverless-mcp'

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