Skip to main content
Glama

create-image-item-using-file

Add images to Miro boards from device files or chat uploads by specifying board ID, position, and image data.

Instructions

Create a new image item on a Miro board using file from device or from chat

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
boardIdYesUnique identifier (ID) of the board where the image will be created
imageDataYesBase64 encoded image data from the chat
positionYesPosition of the image on the board
titleNoTitle of the image

Implementation Reference

  • Handler function that processes the tool inputs, decodes base64 image data into a buffer, constructs position metadata, and invokes the Miro API to create an image item on the specified board.
    fn: async ({ boardId, imageData, position, title }) => {
      try {
        if (!boardId) {
          return ServerResponse.error("Board ID is required");
        }
        
        if (!imageData) {
          return ServerResponse.error("Image data is required");
        }
    
        let imageBuffer;
        try {
          const base64Data = imageData.replace(/^data:image\/\w+;base64,/, '');
          imageBuffer = Buffer.from(base64Data, 'base64');
        } catch (error) {
          return ServerResponse.error(`Error decoding Base64 image data: ${error.message}`);
        }
    
        try {
          const metadata = {};
          
          if (position) {
            metadata['position'] = {
              ...position,
              origin: position.origin || 'center',
              relativeTo: position.relativeTo || 'canvas_center'
            };
          }
          
          if (title) {
            metadata['title'] = title;
          }
    
          const result = await MiroClient.getApi().createImageItemUsingLocalFile(boardId, imageBuffer, metadata);
          return ServerResponse.text(JSON.stringify(result, null, 2));
        } catch (error) {
          return ServerResponse.error(`Error uploading image to Miro: ${error.message}`);
        }
      } catch (error) {
        return ServerResponse.error(error);
      }
    }
  • Zod schema defining the input parameters for the tool: boardId, imageData (base64), position object, and optional title.
    args: {
      boardId: z.string().describe("Unique identifier (ID) of the board where the image will be created"),
      imageData: z.string().describe("Base64 encoded image data from the chat"),
      position: z.object({
        x: z.number().describe("X coordinate of the image"),
        y: z.number().describe("Y coordinate of the image"),
        origin: z.string().optional().nullish().describe("Origin of the image (center, top-left, etc.)"),
        relativeTo: z.string().optional().nullish().describe("Reference point (canvas_center, etc.)")
      }).describe("Position of the image on the board"),
      title: z.string().optional().nullish().describe("Title of the image")
    },
  • src/index.ts:52-52 (registration)
    Import statement for the create-image-item-using-file tool definition.
    import createImageItemUsingFileFromDeviceTool from './tools/createImageItemUsingFileFromDevice.js';
  • src/index.ts:152-152 (registration)
    Registration of the tool with the ToolBootstrapper.
    .register(createImageItemUsingFileFromDeviceTool)
Behavior2/5

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

With no annotations provided, the description carries full burden but reveals minimal behavioral information. It states this is a creation operation but doesn't disclose permissions required, rate limits, whether the image is uploaded immediately, what happens on failure, or the format of any response. The description mentions 'from device or from chat' but doesn't clarify how this choice is made or if there are different requirements for each source.

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

Conciseness4/5

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

The description is a single, efficient sentence that gets straight to the point. It's appropriately sized for a creation tool, though it could potentially be more structured by separating the 'what' from the 'how' aspects. No wasted words or redundant information.

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?

For a creation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after creation (does it return an item ID?), what errors might occur, authentication requirements, or how the tool behaves with different file types/sizes. Given the complexity of image upload and board positioning, more contextual information would be helpful.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional parameter information beyond what's in the schema - it doesn't explain the relationship between parameters, provide examples, or clarify edge cases. The baseline of 3 is appropriate when the schema does the heavy lifting.

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 image item') and resource ('on a Miro board'), specifying the method ('using file from device or from chat'). It distinguishes from sibling 'create-image-item-using-url' by mentioning file-based creation, but doesn't explicitly contrast with other image-related tools like 'update-image-item-using-file'.

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. It doesn't mention when to choose file-based creation over URL-based creation (create-image-item-using-url), or when to use this versus bulk creation tools (create-items-in-bulk-using-file). No prerequisites, constraints, or typical use cases are provided.

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