Skip to main content
Glama

create-shape-item

Add geometric shapes like rectangles, circles, or triangles to Miro boards with customizable text, position, dimensions, and styling.

Instructions

Create a new shape item on a Miro board

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
boardIdYesUnique identifier (ID) of the board where the shape will be created
dataYesThe content and configuration of the shape
positionYesPosition of the shape on the board
geometryYesDimensions of the shape
styleNoStyle configuration of the shape

Implementation Reference

  • The handler function that implements the core logic of the 'create-shape-item' tool. It validates inputs, constructs a ShapeCreateRequest object using Miro API models, and calls the MiroClient to create the shape item on the specified board.
    fn: async ({ boardId, data, position, geometry, style }) => {
      try {
        if (!boardId) {
          return ServerResponse.error("Board ID is required");
        }
    
        if (!validShapeTypes.includes(data.type)) {
          return ServerResponse.error("Invalid shape type. Valid types are: " + validShapeTypes.join(", "));
        }
    
        const createRequest = new ShapeCreateRequest();
        
        const shapeData = new ShapeData();
        // Set shape type via property assignment
        (shapeData as any).type = data.type;
        
        if (data.content !== undefined) {
          shapeData.content = data.content;
        }
        
        createRequest.data = shapeData;
        
        const completePosition = {
          ...position,
          origin: position.origin || "center",
          relativeTo: position.relativeTo || "canvas_center"
        };
        
        createRequest.position = completePosition;
        createRequest.geometry = geometry;
        
        if (style) {
          createRequest.style = style as Record<string, any>;
        }
    
        const result = await MiroClient.getApi().createShapeItem(boardId, createRequest);
        return ServerResponse.text(JSON.stringify(result, null, 2));
      } catch (error) {
        return ServerResponse.error(error);
      }
    }
  • Zod-based input schema defining the parameters for the 'create-shape-item' tool: boardId, data (shape type and content), position, geometry, and optional style.
    args: {
      boardId: z.string().describe("Unique identifier (ID) of the board where the shape will be created"),
      data: z.object({
        shape: z.string().describe("Type of the shape (rectangle, circle, triangle, etc.)"),
        content: z.string().optional().nullish().describe("Text content to display inside the shape")
      }).describe("The content and configuration of the shape"),
      position: z.object({
        x: z.number().describe("X coordinate of the shape"),
        y: z.number().describe("Y coordinate of the shape")
      }).describe("Position of the shape on the board"),
      geometry: z.object({
        width: z.number().describe("Width of the shape"),
        height: z.number().describe("Height of the shape"),
        rotation: z.number().optional().nullish().describe("Rotation angle of the shape")
      }).describe("Dimensions of the shape"),
      style: z.object({
        borderColor: z.string().optional().nullish().describe("Color of the shape border (hex format, e.g. #000000)"),
        borderWidth: z.number().optional().nullish().describe("Width of the shape border"),
        borderStyle: z.string().optional().nullish().describe("Style of the shape border (normal, dashed, etc.)"),
        borderOpacity: z.number().optional().nullish().describe("Opacity of the shape border (0-1)"),
        fillColor: z.string().optional().nullish().describe("Fill color of the shape (hex format, e.g. #000000)"),
        fillOpacity: z.number().optional().nullish().describe("Opacity of the shape fill (0-1)"),
        color: z.string().optional().nullish().describe("Color of the text in the shape (hex format, e.g. #000000)")
      }).optional().nullish().describe("Style configuration of the shape")
    },
  • src/index.ts:157-157 (registration)
    Registration of the 'create-shape-item' tool using ToolBootstrapper.register() in the main index file.
    .register(createShapeItemTool)
  • src/index.ts:57-57 (registration)
    Import of the createShapeItemTool module in the main index file for registration.
    import createShapeItemTool from './tools/createShapeItem.js';
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Create a new shape item,' implying a write operation, but doesn't mention permissions, side effects, rate limits, or what happens on failure. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly, which is ideal for conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters, nested objects, mutation operation) and lack of annotations or output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions, error handling, or return values, leaving gaps that could hinder an AI agent's effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond the schema, such as explaining relationships between parameters or usage examples. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a new shape item') and resource ('on a Miro board'), making the purpose immediately understandable. However, it doesn't differentiate this tool from other shape-related tools like 'update-shape-item' or 'delete-shape-item' among the siblings, which would require more specificity for a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'create-items-in-bulk' for batch creation or 'update-shape-item' for modifications, there's no indication of appropriate contexts, prerequisites, or exclusions, leaving usage ambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/k-jarzyna/mcp-miro'

If you have feedback or need assistance with the MCP directory API, please join our Discord server