Skip to main content
Glama
messages.ts635 B
import { ConvexError, v } from "convex/values"; import { action, mutation } from "./_generated/server"; export const sendAIMessage = action({ args: { prompt: v.string() }, handler: async (): Promise<string> => { const response = await fetch("https://www.example.com/ai"); const text = await response.text(); return text; }, }); export const send = mutation({ args: { body: v.string(), author: v.string() }, handler: async (ctx, { body, author }) => { if (body === "") { throw new ConvexError("Empty message body is not allowed"); } await ctx.db.insert("messages", { body, author }); }, });

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

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