Skip to main content
Glama
types.ts1.82 kB
import { z } from "zod"; // Configuration schemas export const AuthConfigSchema = z.discriminatedUnion("type", [ z.object({ type: z.literal("token"), token: z.string(), }), z.object({ type: z.literal("login"), username: z.string(), password: z.string(), loginEndpoint: z.string(), tokenField: z.string().default("access_token"), }), ]); export const ConfigSchema = z.object({ baseUrl: z.string().url(), swaggerUrl: z.string().url().optional(), auth: AuthConfigSchema, timeout: z.number().default(30000), retries: z.number().default(3), }); export type Config = z.infer<typeof ConfigSchema>; export type AuthConfig = z.infer<typeof AuthConfigSchema>; // API Response types export interface ApiResponse<T = any> { data: T; status: number; statusText: string; headers: Record<string, string>; } // Swagger/OpenAPI types export interface SwaggerEndpoint { path: string; method: string; summary?: string; description?: string; parameters?: SwaggerParameter[]; requestBody?: SwaggerRequestBody; responses?: Record<string, SwaggerResponse>; } export interface SwaggerParameter { name: string; in: "query" | "path" | "header" | "cookie"; required?: boolean; schema?: any; description?: string; } export interface SwaggerRequestBody { required?: boolean; content?: Record<string, any>; description?: string; } export interface SwaggerResponse { description: string; content?: Record<string, any>; } // Authentication state export interface AuthState { token?: string; expiresAt?: Date; isAuthenticated: boolean; } // Request options export interface RequestOptions { method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH"; path: string; params?: Record<string, any>; body?: any; headers?: Record<string, string>; }

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/gyuco/mcp-http-client'

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