@atray/mcp 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +5 -3
- package/src/tools.js +18 -16
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { tools } from './tools.js';
|
|
|
10
10
|
import { api } from './api.js';
|
|
11
11
|
|
|
12
12
|
const server = new Server(
|
|
13
|
-
{ name: 'atray-mcp', version: '1.0.
|
|
13
|
+
{ name: 'atray-mcp', version: '1.0.7' },
|
|
14
14
|
{ capabilities: { tools: {} } }
|
|
15
15
|
);
|
|
16
16
|
|
|
@@ -103,7 +103,7 @@ async function callTool(name, a) {
|
|
|
103
103
|
|
|
104
104
|
const IMAGE_MIME = { jpg: 'image/jpeg', jpeg: 'image/jpeg', png: 'image/png', webp: 'image/webp' };
|
|
105
105
|
|
|
106
|
-
async function uploadPostImage({ id, file_path, image_url }) {
|
|
106
|
+
async function uploadPostImage({ id, file_path, image_url, slot_index }) {
|
|
107
107
|
if (!id) throw new Error('id (post UUID) is required');
|
|
108
108
|
if (!file_path && !image_url) throw new Error('Provide file_path (local file) or image_url (public URL)');
|
|
109
109
|
|
|
@@ -129,7 +129,9 @@ async function uploadPostImage({ id, file_path, image_url }) {
|
|
|
129
129
|
|
|
130
130
|
const base64 = buffer.toString('base64');
|
|
131
131
|
const ext = m[1] === 'jpg' ? 'jpeg' : m[1];
|
|
132
|
-
|
|
132
|
+
const body = { image: `data:image/${ext};base64,${base64}`, filename };
|
|
133
|
+
if (slot_index != null) body.slot_index = Number(slot_index);
|
|
134
|
+
return api.post(`/posts/${id}/image`, body);
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
const VIDEO_MIME = { mp4: 'video/mp4', mov: 'video/quicktime', webm: 'video/webm' };
|
package/src/tools.js
CHANGED
|
@@ -146,21 +146,22 @@ export const tools = [
|
|
|
146
146
|
|
|
147
147
|
{
|
|
148
148
|
name: 'createPost',
|
|
149
|
-
description: 'Creates a standalone post draft. Use type="carousel" with image_descriptions[] (3-6 items) for a carousel post. Default type="text" uses image_description for a single image.',
|
|
149
|
+
description: 'Creates a standalone post draft. Use type="carousel" with image_descriptions[] (3-6 items) for a carousel post. Default type="text" uses image_description for a single image. Set skip_image_generation=true when you plan to upload your own image with uploadPostImage right after — prevents the AI from generating and overwriting your upload.',
|
|
150
150
|
inputSchema: {
|
|
151
151
|
type: 'object',
|
|
152
152
|
properties: {
|
|
153
|
-
campaign_id:
|
|
154
|
-
type:
|
|
155
|
-
placement:
|
|
156
|
-
caption_text:
|
|
157
|
-
cta:
|
|
158
|
-
hashtags:
|
|
159
|
-
image_description:
|
|
160
|
-
image_descriptions:
|
|
161
|
-
context:
|
|
162
|
-
image_text_enabled:
|
|
163
|
-
image_logo_enabled:
|
|
153
|
+
campaign_id: { type: 'string', description: 'Campaign UUID to link to (optional)' },
|
|
154
|
+
type: { type: 'string', enum: ['text', 'carousel'], description: 'Post type (default: text)' },
|
|
155
|
+
placement: { type: 'string', enum: ['feed', 'story'], description: 'Publish destination (default: feed). "story" publishes as an Instagram Story (single media only; not for carousel).' },
|
|
156
|
+
caption_text: { type: 'string', description: 'Post caption text' },
|
|
157
|
+
cta: { type: 'string', description: 'Call-to-action text (e.g. "Link in bio")' },
|
|
158
|
+
hashtags: { type: 'array', items: { type: 'string' }, description: 'Hashtags (without #)' },
|
|
159
|
+
image_description: { type: 'string', description: 'Image description for single-image posts (type=text)' },
|
|
160
|
+
image_descriptions: { type: 'array', items: { type: 'string' }, description: 'Image description per slide for carousel posts (type=carousel, 3-6 items)' },
|
|
161
|
+
context: { type: 'string', description: 'Context/brief for AI text generation (required for standalone posts)' },
|
|
162
|
+
image_text_enabled: { type: 'boolean', description: 'Include text overlay in generated image (default: true)' },
|
|
163
|
+
image_logo_enabled: { type: 'boolean', description: 'Include brand logo in generated image (default: true)' },
|
|
164
|
+
skip_image_generation: { type: 'boolean', description: 'Set to true to skip AI image generation. Use when you will upload your own image with uploadPostImage after creating the post.' },
|
|
164
165
|
},
|
|
165
166
|
},
|
|
166
167
|
},
|
|
@@ -228,14 +229,15 @@ export const tools = [
|
|
|
228
229
|
|
|
229
230
|
{
|
|
230
231
|
name: 'uploadPostImage',
|
|
231
|
-
description: 'Uploads a custom image (jpg, jpeg, png or webp) as the post media, replacing the current AI-generated image. Provide either file_path (local file) or image_url (public URL to download from).',
|
|
232
|
+
description: 'Uploads a custom image (jpg, jpeg, png or webp) as the post media, replacing the current AI-generated image. Provide either file_path (local file) or image_url (public URL to download from). For carousel posts, use slot_index (0-based) to target a specific slide; omit to replace slide 0.',
|
|
232
233
|
inputSchema: {
|
|
233
234
|
type: 'object',
|
|
234
235
|
required: ['id'],
|
|
235
236
|
properties: {
|
|
236
|
-
id:
|
|
237
|
-
file_path:
|
|
238
|
-
image_url:
|
|
237
|
+
id: { type: 'string', description: 'Post UUID' },
|
|
238
|
+
file_path: { type: 'string', description: 'Absolute path to a local image file (jpg, jpeg, png, webp)' },
|
|
239
|
+
image_url: { type: 'string', description: 'Public URL of the image to download and upload' },
|
|
240
|
+
slot_index: { type: 'number', description: 'Carousel slide index (0-based). Required to fill slides beyond the first one.' },
|
|
239
241
|
},
|
|
240
242
|
},
|
|
241
243
|
},
|