Skip to main content
Glama

JSON MCP Server

JsonIngestionStrategy.ts1.44 kB
import { JsonIngestionResult, IngestionMetadata } from '../types/JsonIngestion.js'; /** * Abstract strategy interface for ingesting JSON data from various sources */ export abstract class JsonIngestionStrategy { /** * Determines if this strategy can handle the given source * @param source - The source identifier (file path, URL, etc.) * @returns true if this strategy can handle the source */ abstract canHandle(source: string): boolean; /** * Ingests JSON content from the source * @param source - The source identifier to ingest from * @returns Promise resolving to JSON content or error */ abstract ingest(source: string): Promise<JsonIngestionResult>; /** * Returns metadata about this strategy * @returns Strategy metadata */ abstract getMetadata(): { name: string; description: string; supportedSources: string[] }; /** * Validates that the ingested content is valid JSON * @param content - Raw content to validate * @returns JsonIngestionResult with validation result */ protected validateJsonContent(content: string): JsonIngestionResult { try { JSON.parse(content); return { success: true, content }; } catch (error) { return { success: false, error: { type: 'invalid_json', message: 'Invalid JSON format in content', details: 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/kehvinbehvin/json-mcp'

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