Skip to main content
Glama

Convex MCP server

Official
by get-convex
messages.ts753 B
import { mutationWithZod, queryWithZod } from "./lib/zod"; import { z } from "zod"; import { Doc } from "./_generated/dataModel"; import { withSystemFields } from "convex-helpers/server/zod"; export const send = mutationWithZod({ args: { body: z.string(), author: z.string() }, handler: async (ctx, { body, author }) => { await ctx.db.insert("messages", { body, author }); }, }); export const list = queryWithZod({ args: {}, // We don't have any args to validate handler: async (ctx): Promise<Doc<"messages">[]> => { return await ctx.db.query("messages").collect(); }, // Output validation is optional output: z.array( z.object( withSystemFields("messages", { body: z.string(), author: z.string() }), ), ), });

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