create-document-item
Add a document to a Miro board by specifying its URL, position, and optional title or dimensions for collaborative visualization.
Instructions
Create a new document item on a Miro board
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| boardId | Yes | Unique identifier (ID) of the board where the document will be created | |
| data | Yes | The content and configuration of the document | |
| position | Yes | Position of the document on the board | |
| geometry | No | Dimensions of the document |
Implementation Reference
- src/tools/createDocumentItem.ts:27-52 (handler)The handler function that creates a document item on a Miro board using the Miro API. It constructs a DocumentCreateRequest with the provided data, position, and optional geometry, then calls createDocumentItemUsingUrl.fn: async ({ boardId, data, position, geometry }) => { try { if (!boardId) { return ServerResponse.error("Board ID is required"); } const createRequest = new DocumentCreateRequest(); const documentData = new DocumentUrlData(); documentData.url = data.url; if (data.title !== undefined) documentData.title = data.title; createRequest.data = documentData; createRequest.position = position; if (geometry) { createRequest.geometry = geometry; } const result = await MiroClient.getApi().createDocumentItemUsingUrl(boardId, createRequest); return ServerResponse.text(JSON.stringify(result, null, 2)); } catch (error) { return ServerResponse.error(error); } }
- Input schema using Zod for validating parameters: boardId (string), data (object with url and optional title), position (object with x and y), optional geometry (object with width and height).args: { boardId: z.string().describe("Unique identifier (ID) of the board where the document will be created"), data: z.object({ url: z.string().describe("URL of the document to be added to the board"), title: z.string().optional().nullish().describe("Title of the document") }).describe("The content and configuration of the document"), position: z.object({ x: z.number().describe("X coordinate of the document"), y: z.number().describe("Y coordinate of the document") }).describe("Position of the document on the board"), geometry: z.object({ width: z.number().optional().nullish().describe("Width of the document"), height: z.number().optional().nullish().describe("Height of the document") }).optional().nullish().describe("Dimensions of the document") },
- src/index.ts:142-142 (registration)Registers the create-document-item tool in the ToolBootstrapper chain..register(createDocumentItemTool)
- src/index.ts:41-41 (registration)Imports the createDocumentItemTool for registration.import createDocumentItemTool from './tools/createDocumentItem.js';