Skip to main content
Glama

Convex MCP server

Official
by get-convex
readingDataAverage.ts497 B
import { query } from "./_generated/server"; import { v } from "convex/values"; export const averagePurchasePrice = query({ args: { email: v.string() }, handler: async (ctx, args) => { const userPurchases = await ctx.db .query("purchases") .withIndex("by_buyer", (q) => q.eq("buyer", args.email)) .collect(); // highlight-start const sum = userPurchases.reduce((a, { value: b }) => a + b, 0); return sum / userPurchases.length; // highlight-end }, });

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/get-convex/convex-backend'

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