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
| 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 |
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 connector will be created",
"type": "string"
},
"endItem": {
"additionalProperties": false,
"description": "End item of the connector",
"properties": {
"id": {
"description": "ID of the item at the end of the connector",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"startItem": {
"additionalProperties": false,
"description": "Start item of the connector",
"properties": {
"id": {
"description": "ID of the item at the start of the connector",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"style": {
"additionalProperties": false,
"description": "Style configuration of the connector",
"properties": {
"endStrokeCap": {
"description": "End stroke cap style",
"type": "string"
},
"startStrokeCap": {
"description": "Start stroke cap style",
"type": "string"
},
"strokeColor": {
"description": "Color of the connector stroke",
"type": "string"
},
"strokeStyle": {
"description": "Style of the connector stroke (normal, dashed, etc.)",
"type": "string"
},
"strokeWidth": {
"description": "Width of the connector stroke",
"type": "number"
}
},
"type": "object"
}
},
"required": [
"boardId",
"startItem",
"endItem"
],
"type": "object"
}
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",