update-document-item
Modify document items on Miro boards by updating content, position, or dimensions to keep collaborative workspaces current.
Instructions
Update an existing document item on a Miro board
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| boardId | Yes | Unique identifier (ID) of the board that contains the document | |
| itemId | Yes | Unique identifier (ID) of the document that you want to update | |
| data | No | The updated content and configuration of the document | |
| position | No | Updated position of the document on the board | |
| geometry | No | Updated dimensions of the document |
Implementation Reference
- src/tools/updateDocumentItem.ts:27-67 (handler)The main handler function that executes the tool logic: validates required boardId and itemId, constructs a DocumentUpdateRequest with optional data, position, and geometry, calls the Miro API to update the document item, and returns the result or error.fn: async ({ boardId, itemId, data, position, geometry }) => { try { if (!boardId) { return ServerResponse.error("Board ID is required"); } if (!itemId) { return ServerResponse.error("Item ID is required"); } const updateRequest = new DocumentUpdateRequest(); if (data) { const documentData = new DocumentUrlData(); if (data.url !== undefined) documentData.url = data.url; if (data.title !== undefined) documentData.title = data.title; if (Object.keys(documentData).length > 0) { updateRequest.data = documentData; } } if (position) { updateRequest.position = position; } if (geometry) { updateRequest.geometry = geometry; } if (Object.keys(updateRequest).length === 0) { return ServerResponse.error("No data provided for update"); } const result = await MiroClient.getApi().updateDocumentItemUsingUrl(boardId, itemId, updateRequest); return ServerResponse.text(JSON.stringify(result, null, 2)); } catch (error) { return ServerResponse.error(error); } }
- Zod input schema defining parameters for the tool: boardId (required string), itemId (required string), optional data (url/title), position (x/y), geometry (width/height).args: { boardId: z.string().describe("Unique identifier (ID) of the board that contains the document"), itemId: z.string().describe("Unique identifier (ID) of the document that you want to update"), data: z.object({ url: z.string().optional().nullish().describe("Updated URL of the document"), title: z.string().optional().nullish().describe("Updated title of the document") }).optional().nullish().describe("The updated content and configuration of the document"), position: z.object({ x: z.number().optional().nullish().describe("Updated X coordinate of the document"), y: z.number().optional().nullish().describe("Updated Y coordinate of the document") }).optional().nullish().describe("Updated position of the document on the board"), geometry: z.object({ width: z.number().optional().nullish().describe("Updated width of the document"), height: z.number().optional().nullish().describe("Updated height of the document") }).optional().nullish().describe("Updated dimensions of the document") },
- src/index.ts:144-144 (registration)The line where the updateDocumentItemTool is registered with the ToolBootstrapper instance to make it available in the MCP server..register(updateDocumentItemTool)
- src/index.ts:43-43 (registration)Import statement that loads the tool definition for registration.import updateDocumentItemTool from './tools/updateDocumentItem.js';