Skip to main content
Glama

Convex MCP server

Official
by get-convex
args_validation.ts892 B
import { v } from "convex/values"; import { mutation, query } from "./_generated/server"; import { Id } from "./_generated/dataModel"; export const stringArg = query({ args: { arg: v.string(), }, handler: (_, { arg }) => { return arg; }, }); export const returnRecord = mutation({ args: {}, handler: async (ctx) => { const boat = await ctx.db.insert("boats", { name: "boat" }); const boatVote = await ctx.db.insert("boatVotes", { boat }); const result: Record<Id<"boats"> | Id<"boatVotes">, number> = {}; result[boat] = 1; result[boatVote] = 2; return result; }, }); export const recordArg = query({ args: { // This is a silly record, but is the easiest way to test a subtype of string // as a key arg: v.record(v.union(v.id("boats"), v.id("boatVotes")), v.number()), }, handler: (_, { arg }) => { return arg; }, });

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