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 { v } from "convex/values";
import { mutationWithSession, queryWithSession } from "./lib/sessions";
/**
* Gets the name from the current session.
*/
export const get = queryWithSession({
args: {},
handler: async (ctx) => {
// ctx.user is set in the queryWithSession wrapper.
return ctx.user?.name ?? null;
},
});
/**
* Updates the name in the current session.
*/
export const set = mutationWithSession({
args: {
name: v.string(),
},
handler: async (ctx, { name }) => {
if (ctx.user) {
await ctx.db.patch(ctx.user._id, { name });
} else {
await ctx.db.insert("users", { name, sessionId: ctx.sessionId });
}
},
});