Skip to main content
Glama

mcp-google-sheets

pinecone-client.ts1.22 kB
import { Pinecone, type PineconeConfiguration } from '@pinecone-database/pinecone'; export interface PineconeAuthConfig { apiKey: string; } export function createPineconeClient(authConfig: PineconeAuthConfig): Pinecone { if (!authConfig.apiKey) { throw new Error('Pinecone API key is required. Please provide a valid API key from your Pinecone console.'); } const config: PineconeConfiguration = { apiKey: authConfig.apiKey, }; return new Pinecone(config); } export function validateApiKey(apiKey: string): void { if (!apiKey || typeof apiKey !== 'string') { throw new Error('Invalid API key: API key must be a non-empty string'); } if (apiKey.length < 10) { throw new Error('Invalid API key: API key appears to be too short'); } } export function createPineconeClientFromAuth(auth: any): Pinecone { if (typeof auth === 'string') { return createPineconeClient({ apiKey: auth }); } let actualAuth = auth; if (auth && auth.props) { actualAuth = auth.props; } if (!actualAuth || !actualAuth.apiKey) { throw new Error('Invalid authentication: API key is required'); } return createPineconeClient({ apiKey: actualAuth.apiKey, }); }

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

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