create-text-item
Add text content to a Miro board by specifying position, style, and dimensions for visual collaboration.
Instructions
Create a new text item on a Miro board
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| boardId | Yes | Unique identifier (ID) of the board where the text will be created | |
| data | Yes | The content of the text item | |
| position | Yes | Position of the text item on the board | |
| geometry | No | Dimensions of the text item | |
| style | No | Style configuration of the text item |
Implementation Reference
- src/tools/createTextItem.ts:30-57 (handler)The handler function that implements the logic to create a text item on a Miro board using the Miro API client.fn: async ({ boardId, data, position, geometry, style }) => { try { if (!boardId) { return ServerResponse.error("Board ID is required"); } const createRequest = new TextCreateRequest(); const textData = new TextData(); textData.content = data.content; createRequest.data = textData; createRequest.position = position; if (geometry) { createRequest.geometry = geometry; } if (style) { createRequest.style = style; } const result = await MiroClient.getApi().createTextItem(boardId, createRequest); return ServerResponse.text(JSON.stringify(result, null, 2)); } catch (error) { return ServerResponse.error(error); } }
- src/tools/createTextItem.ts:12-29 (schema)Zod-based input schema defining parameters for the create-text-item tool: boardId, data.content, position, optional geometry.width, and style properties.args: { boardId: z.string().describe("Unique identifier (ID) of the board where the text will be created"), data: z.object({ content: z.string().describe("Text content of the text item") }).describe("The content of the text item"), position: z.object({ x: z.number().describe("X coordinate of the text item"), y: z.number().describe("Y coordinate of the text item") }).describe("Position of the text item on the board"), geometry: z.object({ width: z.number().optional().nullish().describe("Width of the text item") }).optional().nullish().describe("Dimensions of the text item"), style: z.object({ color: z.string().optional().nullish().describe("Color of the text"), fontSize: z.number().optional().nullish().describe("Font size of the text"), textAlign: z.string().optional().nullish().describe("Alignment of the text (left, center, right)") }).optional().nullish().describe("Style configuration of the text item") },
- src/index.ts:146-146 (registration)Registers the createTextItemTool (create-text-item) with the ToolBootstrapper instance in the main index file..register(createTextItemTool)