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
import { MESSAGES_TABLE } from "../types";
import { mutation } from "./_generated/server";
export default mutation({
handler: async ({ db }): Promise<void> => {
// Update an existing document. This makes the mutations conflicts with each
// other and generates a record with a lot of versions which helps us test
// the database is efficiently processing those.
// We add a row with rand=0 in setup so this should never fail.
const row = await db
.query(MESSAGES_TABLE)
.withIndex("by_channel_rand", (q) =>
q.eq("channel", "global").eq("rand", 0),
)
.first();
if (row === null) {
throw new Error("No rows!");
}
const timestamp = Date.now();
if (row.timestamp < timestamp) {
await db.patch("messages", row._id, { timestamp: timestamp });
}
},
});