Skip to main content
Glama
iswalle

GetNote MCP Server

by iswalle

upload_image

Upload images to cloud storage for use in GetNote platform notes. Accepts local file paths or Base64 data and returns image URLs for embedding in documents.

Instructions

上传图片到 OSS。返回 image_url(用于创建图片笔记的 image_urls 参数)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
image_pathNo本地图片文件路径
image_base64No图片的 Base64 编码数据(与 image_path 二选一)
mime_typeNo图片类型(如 png、jpg、jpeg),默认 pngpng

Implementation Reference

  • MCP tool handler case for "upload_image" which orchestrates reading the image and calling the client method.
    const result = await client.uploadImage(imageData, mimeType);
    return { 
      success: true, 
      image_url: result.access_url,  // 用于创建图片笔记
      image_id: result.image_id      // OSS 回调返回的 ID
    };
  • Implementation of uploadImage in the client class.
    async uploadImage(
      imageData: Buffer | Uint8Array,
      mimeType: string = "png"
    ): Promise<{ image_id: string; access_url: string }> {
      // 1. 获取上传凭证(现在直接返回单个对象)
      const token = await this.getUploadToken({ mime_type: mimeType });
    
      // 2. 上传到 OSS
      const { image_id } = await this.uploadImageToOSS(token, imageData);
    
      // 3. 返回结果
      return { image_id, access_url: token.access_url };
    }
  • src/index.ts:362-381 (registration)
    MCP tool registration for "upload_image".
    name: "upload_image",
    description:
      "上传图片到 OSS。返回 image_url(用于创建图片笔记的 image_urls 参数)。",
    inputSchema: {
      type: "object" as const,
      properties: {
        image_path: {
          type: "string",
          description: "本地图片文件路径",
        },
        image_base64: {
          type: "string",
          description: "图片的 Base64 编码数据(与 image_path 二选一)",
        },
        mime_type: {
          type: "string",
          description: "图片类型(如 png、jpg、jpeg),默认 png",
          default: "png",
        },
      },

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/iswalle/getnote-mcp'

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