Skip to main content
Glama
lazy-client.ts1.19 kB
/** * Enhanced lazy client - uses unified client architecture * Provides lazy initialization with caching and context management */ import { AxiosInstance } from 'axios'; import { createAttioClient } from './attio-client.js'; import { ClientCache, clearAllCaches } from './client-cache.js'; import { getClientContext, setClientContext } from './client-context.js'; import { ClientConfig } from './client-config.js'; export function getLazyAttioClient(config?: ClientConfig): AxiosInstance { // Check if we have a cached client const cachedClient = ClientCache.getInstance(); if (cachedClient && !config?.bypassCache) { return cachedClient; } // Create new client using unified interface const client = createAttioClient(config || {}); // Cache the client for future use if (!config?.bypassCache) { ClientCache.setInstance(client); } return client; } export function setGlobalContext(context: Record<string, unknown>): void { setClientContext(context); } export function clearClientCache(): void { // Use unified cache clearing clearAllCaches(); } export function getGlobalContext(): Record<string, unknown> | null { return getClientContext(); }

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/kesslerio/attio-mcp-server'

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