create-text-item
Add a text item to a Miro board by specifying content, position, dimensions, and style. Use this tool to dynamically create and customize text elements on your Miro workspace.
Instructions
Create a new text item on a Miro board
Input 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 | |
| geometry | No | Dimensions of the text item | |
| position | Yes | Position of the text item on the board | |
| style | No | Style configuration of the text item |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"boardId": {
"description": "Unique identifier (ID) of the board where the text will be created",
"type": "string"
},
"data": {
"additionalProperties": false,
"description": "The content of the text item",
"properties": {
"content": {
"description": "Text content of the text item",
"type": "string"
}
},
"required": [
"content"
],
"type": "object"
},
"geometry": {
"additionalProperties": false,
"description": "Dimensions of the text item",
"properties": {
"width": {
"description": "Width of the text item",
"type": "number"
}
},
"type": "object"
},
"position": {
"additionalProperties": false,
"description": "Position of the text item on the board",
"properties": {
"x": {
"description": "X coordinate of the text item",
"type": "number"
},
"y": {
"description": "Y coordinate of the text item",
"type": "number"
}
},
"required": [
"x",
"y"
],
"type": "object"
},
"style": {
"additionalProperties": false,
"description": "Style configuration of the text item",
"properties": {
"color": {
"description": "Color of the text",
"type": "string"
},
"fontSize": {
"description": "Font size of the text",
"type": "number"
},
"textAlign": {
"description": "Alignment of the text (left, center, right)",
"type": "string"
}
},
"type": "object"
}
},
"required": [
"boardId",
"data",
"position"
],
"type": "object"
}
Implementation Reference
- src/tools/createTextItem.ts:30-57 (handler)The asynchronous handler function that creates a text item on the specified Miro board using the Miro API. It validates the boardId, constructs the request object with provided data, position, geometry, and style, and returns the result or an error.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 schema defining the input parameters for the tool: boardId (required), data.content (required), position.x/y (required), and 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 with the ToolBootstrapper instance, making the "create-text-item" tool available in the MCP server..register(createTextItemTool)