create-card-item
Add a new card to a Miro board with customizable content, position, and styling for organizing tasks and information visually.
Instructions
Create a new card item on a Miro board
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| boardId | Yes | Unique identifier (ID) of the board where the card will be created | |
| data | Yes | The content and configuration of the card | |
| position | Yes | Position of the card on the board | |
| geometry | No | Dimensions of the card | |
| style | No | Style configuration of the card |
Implementation Reference
- src/tools/createCardItem.ts:33-67 (handler)The async handler function that executes the logic for creating a card item on a Miro board using the MiroClient API.fn: async ({ boardId, data, position, geometry, style }) => { try { if (!boardId) { return ServerResponse.error("Board ID is required"); } const createRequest = new CardCreateRequest(); const cardData = new CardData(); cardData.title = data.title; if (data.description !== undefined) cardData.description = data.description; if (data.assigneeId !== undefined) cardData.assigneeId = data.assigneeId; if (data.dueDate !== undefined) { cardData.dueDate = new Date(data.dueDate); } createRequest.data = cardData; createRequest.position = position; if (geometry) { createRequest.geometry = geometry; } if (style) { createRequest.style = style; } const result = await MiroClient.getApi().createCardItem(boardId, createRequest); return ServerResponse.text(JSON.stringify(result, null, 2)); } catch (error) { return ServerResponse.error(error); } }
- src/tools/createCardItem.ts:9-32 (schema)The ToolSchema definition including the tool name, description, and input schema using Zod for parameter validation.const createCardItemTool: ToolSchema = { name: "create-card-item", description: "Create a new card item on a Miro board", args: { boardId: z.string().describe("Unique identifier (ID) of the board where the card will be created"), data: z.object({ title: z.string().describe("Title of the card"), description: z.string().optional().nullish().describe("Description of the card"), assigneeId: z.string().optional().nullish().describe("User ID of the assignee"), dueDate: z.string().optional().nullish().describe("Due date for the card (ISO 8601 format)") }).describe("The content and configuration of the card"), position: z.object({ x: z.number().describe("X coordinate of the card"), y: z.number().describe("Y coordinate of the card") }).describe("Position of the card on the board"), geometry: z.object({ width: z.number().optional().nullish().describe("Width of the card"), height: z.number().optional().nullish().describe("Height of the card"), rotation: z.number().optional().nullish().describe("Rotation angle of the card") }).optional().nullish().describe("Dimensions of the card"), style: z.object({ cardTheme: z.string().optional().nullish().describe("Color of the card") }).optional().nullish().describe("Style configuration of the card") },
- src/index.ts:125-125 (registration)The line where the createCardItemTool is registered with the ToolBootstrapper to make it available as an MCP tool..register(createCardItemTool)