create-card-item
Add a new card to a Miro board with customizable title, description, assignee, due date, position, dimensions, and style using the MCP server.
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 | |
| geometry | No | Dimensions of the card | |
| position | Yes | Position of the card on the board | |
| style | No | Style configuration of the card |
Implementation Reference
- src/tools/createCardItem.ts:33-67 (handler)The handler function that implements the core logic of the 'create-card-item' tool. It validates inputs, constructs a CardCreateRequest object, and uses MiroClient to create a card item on the board.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:12-32 (schema)Zod-based input schema defining the parameters for the 'create-card-item' tool, including boardId, data, position, geometry, and style.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 registration of the create-card-item tool in the main ToolBootstrapper chain in src/index.ts..register(createCardItemTool)
- src/index.ts:24-24 (registration)The import statement for the createCardItemTool in the main index file.import createCardItemTool from './tools/createCardItem.js';