Skip to main content
Glama
schemas.ts•1.81 kB
import { z } from "zod"; import { smartContractNameRegex, smartContractSymbolRegex } from "./constants"; export const createSmartContractSchema = z.object({ name: z .string() .regex( smartContractNameRegex, "Name must be between 3 and 30 characters long and can contain only letters, numbers and [_.-] symbols", ), symbol: z .string() .regex( smartContractSymbolRegex, "Identifier must be between 3 and 30 characters long and can contain only letters, numbers and underscores", ), type: z.enum(["ERC721", "ERC1155"]), }); export const createAssetSchema = z .object({ title: z .string() .min(3, "Title must be at least 3 characters long") .max(120, "Title must be no more than 120 characters long"), description: z.string().max(255, "Description must be no more than 255 characters long").optional(), location: z.string().max(100, "Location must be no more than 100 characters long").optional(), contractId: z.string().min(1, "Please select a collection"), editions: z .number() .min(1, "Editions must be at least 1") .max(1000, "Editions must be no more than 1000") .optional(), shareWithCommunity: z.boolean().optional().default(false), // Option 1: File from disk filePath: z.string().optional(), // Option 2: Base64 data (for Claude Desktop) fileData: z.string().optional(), // base64 encoded data fileName: z.string().optional(), // original filename mimeType: z.string().optional(), // MIME type }) .refine((data) => data.filePath || (data.fileData && data.fileName && data.mimeType), { message: "Either filePath OR (fileData + fileName + mimeType) must be provided", path: ["filePath"], // This will show the error on the filePath field });

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/xkelxmc/uranium-mcp'

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