Skip to main content
Glama
todoBuilder.js1.4 kB
export function buildTodoCard(todos) { const parsedTodos = JSON.parse(todos); const widgets = parsedTodos.map((todo, index) => { const icon = todo.type === "email" ? "EMAIL" : "INVITE"; return { decoratedText: { icon: { knownIcon: icon, }, text: todo.text, bottomLabel: todo.priority, switchControl: { name: `checkbox${index + 1}`, selected: false, controlType: "CHECK_BOX", }, }, }; }); const cardPayload = { cardsV2: [ { cardId: "unique-card-id", card: { header: { title: "TODO-LIST", subtitle: "Your generated to-do list from email", imageUrl: "https://img.icons8.com/?size=100&id=48215&format=png&color=FFFFFF", imageType: "CIRCLE", }, sections: [ { collapsible: false, uncollapsibleWidgetsCount: 2, widgets, }, ], }, }, ], }; return cardPayload; }

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/rishipradeep-think41/gchat-mcp'

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