Skip to main content
Glama

Memory Bank MCP Server

by yywdandan
is_capped.ts1.32 kB
import type { Collection } from '../collection'; import { MongoAPIError } from '../error'; import type { Server } from '../sdam/server'; import type { ClientSession } from '../sessions'; import type { Callback } from '../utils'; import { AbstractCallbackOperation, type OperationOptions } from './operation'; /** @internal */ export class IsCappedOperation extends AbstractCallbackOperation<boolean> { override options: OperationOptions; collection: Collection; constructor(collection: Collection, options: OperationOptions) { super(options); this.options = options; this.collection = collection; } override executeCallback( server: Server, session: ClientSession | undefined, callback: Callback<boolean> ): void { const coll = this.collection; coll.s.db .listCollections( { name: coll.collectionName }, { ...this.options, nameOnly: false, readPreference: this.readPreference, session } ) .toArray() .then( collections => { if (collections.length === 0) { // TODO(NODE-3485) return callback(new MongoAPIError(`collection ${coll.namespace} not found`)); } callback(undefined, !!collections[0].options?.capped); }, error => callback(error) ); } }

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/yywdandan/memory-bank-mcp-server'

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