Skip to main content
Glama

Weather & Stock MCP Server

by Jeetinida
setGlobalConfig.js1.08 kB
import { YahooFinanceOptionsSchema, } from "./options.js"; import validateAndCoerceTypes from "./validateAndCoerceTypes.js"; import { ExtendedCookieJar } from "./cookieJar.js"; export default function setGlobalConfig(_config) { const parsed = validateAndCoerceTypes({ data: _config, type: "options", options: this._opts.validation, schema: YahooFinanceOptionsSchema, }); // Instances (e.g. cookieJar) don't validate well :) const { cookieJar, ...config } = parsed; mergeObjects(this._opts, config); if (cookieJar) { if (!(cookieJar instanceof ExtendedCookieJar)) throw new Error("cookieJar must be an instance of ExtendedCookieJar"); this._opts.cookieJar = cookieJar; } } function mergeObjects(original, objToMerge) { const ownKeys = Reflect.ownKeys(objToMerge); for (const key of ownKeys) { if (typeof objToMerge[key] === "object") { mergeObjects(original[key], objToMerge[key]); } else { original[key] = objToMerge[key]; } } }

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/Jeetinida/stocknews-mcp'

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