create-connector
Establish visual connections between items on a Miro board by defining start and end points, with customizable style configurations.
Instructions
Create a new connector between items on a Miro board
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| boardId | Yes | Unique identifier (ID) of the board where the connector will be created | |
| endItem | Yes | End item of the connector | |
| startItem | Yes | Start item of the connector | |
| style | No | Style configuration of the connector |
Implementation Reference
- src/tools/createConnector.ts:27-46 (handler)Executes the creation of a connector on a Miro board using the Miro API client. Handles input validation, constructs ConnectorCreationData, makes the API call, and formats the response.fn: async ({ boardId, startItem, endItem, style }) => { try { if (!boardId) { return ServerResponse.error("Board ID is required"); } const connectorData = new ConnectorCreationData(); connectorData.startItem = startItem; connectorData.endItem = endItem; if (style) { connectorData.style = style; } const result = await MiroClient.getApi().createConnector(boardId, connectorData); return ServerResponse.text(JSON.stringify(result, null, 2)); } catch (error) { return ServerResponse.error(error); } }
- src/tools/createConnector.ts:11-26 (schema)Zod schemas defining the input parameters for the create-connector tool: boardId (string), startItem and endItem (objects with id), and optional style object.args: { boardId: z.string().describe("Unique identifier (ID) of the board where the connector will be created"), startItem: z.object({ id: z.string().describe("ID of the item at the start of the connector") }).describe("Start item of the connector"), endItem: z.object({ id: z.string().describe("ID of the item at the end of the connector") }).describe("End item of the connector"), style: z.object({ strokeColor: z.string().optional().nullish().describe("Color of the connector stroke"), strokeWidth: z.number().optional().nullish().describe("Width of the connector stroke"), strokeStyle: z.string().optional().nullish().describe("Style of the connector stroke (normal, dashed, etc.)"), startStrokeCap: z.string().optional().nullish().describe("Start stroke cap style"), endStrokeCap: z.string().optional().nullish().describe("End stroke cap style") }).optional().nullish().describe("Style configuration of the connector") },
- src/index.ts:129-129 (registration)Registers the createConnectorTool with the ToolBootstrapper instance to make it available in the MCP server..register(createConnectorTool)
- src/index.ts:28-28 (registration)Imports the createConnectorTool definition for registration.import createConnectorTool from './tools/createConnector.js';
- src/tools/createConnector.ts:8-10 (schema)ToolSchema object defining the tool name and description.const createConnectorTool: ToolSchema = { name: "create-connector", description: "Create a new connector between items on a Miro board",