Skip to main content
Glama

create_project

Create a new pixel art project by specifying canvas dimensions and a unique identifier. This tool initiates a blank canvas for drawing pixel art.

Instructions

Create a new pixel art project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesUnique identifier for the project
widthYesCanvas width in pixels
heightYesCanvas height in pixels
nameNoProject name (optional)

Implementation Reference

  • The createProject method serves as the handler for the 'create_project' tool, initializing a new Piskel project instance and adding it to the server's projects map.
    private createProject(
      projectId: string,
      width: number,
      height: number,
      name?: string
    ): object {
      if (this.projects.has(projectId)) {
        throw new Error(`Project "${projectId}" already exists`);
      }
    
      const descriptor = { name: name ?? projectId };
      const piskel = new Piskel(width, height, 1, descriptor);
    
      // Add a default layer with one frame
      const defaultLayer = new Layer('Layer 0');
      defaultLayer.addFrame(new Frame(width, height));
      piskel.addLayer(defaultLayer);
    
      this.projects.set(projectId, piskel);
    
      return {
        success: true,
        projectId,
        width,
        height,
        name: name ?? projectId,
      };
    }
  • The tool 'create_project' is defined and registered within the getTools method in PiskelServer.ts, specifying its description and inputSchema.
    {
      name: 'create_project',
      description: 'Create a new pixel art project',
      inputSchema: {
        type: 'object',
        properties: {
          projectId: {
            type: 'string',
            description: 'Unique identifier for the project',
          },
          width: {
            type: 'number',
            description: 'Canvas width in pixels',
          },
          height: {
            type: 'number',
            description: 'Canvas height in pixels',
          },
          name: {
            type: 'string',
            description: 'Project name (optional)',
          },
        },
        required: ['projectId', 'width', 'height'],
  • The inputSchema for 'create_project', defining the expected parameters: projectId, width, height, and optional name.
    inputSchema: {
      type: 'object',
      properties: {
        projectId: {
          type: 'string',
          description: 'Unique identifier for the project',
        },
        width: {
          type: 'number',
          description: 'Canvas width in pixels',
        },
        height: {
          type: 'number',
          description: 'Canvas height in pixels',
        },
        name: {
          type: 'string',
          description: 'Project name (optional)',
        },
      },

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/yafeiaa/piskel-mcp-server'

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