Skip to main content
Glama

Basic Math MCP Server

by bahfahh
tuple.js1.07 kB
import { parseDef } from "../parseDef.js"; export function parseTupleDef(def, refs) { if (def.rest) { return { type: "array", minItems: def.items.length, items: def.items .map((x, i) => parseDef(x._def, { ...refs, currentPath: [...refs.currentPath, "items", `${i}`], })) .reduce((acc, x) => (x === undefined ? acc : [...acc, x]), []), additionalItems: parseDef(def.rest._def, { ...refs, currentPath: [...refs.currentPath, "additionalItems"], }), }; } else { return { type: "array", minItems: def.items.length, maxItems: def.items.length, items: def.items .map((x, i) => parseDef(x._def, { ...refs, currentPath: [...refs.currentPath, "items", `${i}`], })) .reduce((acc, x) => (x === undefined ? acc : [...acc, x]), []), }; } }

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/bahfahh/mcptest'

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