Skip to main content
Glama
updateSchemaIdsForExistingSpecs.ts632 B
import _logger from "../../logger.ts"; import _ from "lodash"; import { ExpandedPkgSpec } from "../../spec/pkgs.ts"; const logger = _logger.ns("updateExisting").seal(); export function updateSchemaIdsForExistingSpecs( existingSpecs: Record<string, string>, specs: ExpandedPkgSpec[], ): ExpandedPkgSpec[] { const newSpecs = [] as ExpandedPkgSpec[]; for (const spec of specs) { const schema_id = existingSpecs[spec.name]; if (schema_id) { logger.debug(`Found existing spec ${spec.name}, updating schema id`); spec.schemas[0].uniqueId = schema_id; } newSpecs.push(spec); } return newSpecs; }

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/systeminit/si'

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