File size: 7,912 Bytes
0f203fb
 
 
 
 
 
 
 
 
51fc219
0f203fb
 
 
 
 
 
 
 
 
51fc219
0f203fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e6992ba
 
 
 
0f203fb
 
 
 
 
 
 
 
 
 
 
51fc219
0f203fb
 
 
 
 
 
 
 
 
51fc219
0f203fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e6992ba
 
 
 
0f203fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e6992ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
/**
 * Schema definitions for the Pollinations Image API
 */

/**
 * Schema for the generateImageUrl tool
 */
export const generateImageUrlSchema = {
  name: 'generateImageUrl',
  description: 'Generate an image URL from a text prompt. User-configured settings in MCP config will be used as defaults unless specifically overridden.',
  inputSchema: {
    type: 'object',
    properties: {
      prompt: {
        type: 'string',
        description: 'The text description of the image to generate'
      },
      model: {
        type: 'string',
        description: 'Model name to use for generation (default: user config or "flux"). Use listImageModels to see all available models'
      },
      seed: {
        type: 'number',
        description: 'Seed for reproducible results (default: random)'
      },
      width: {
        type: 'number',
        description: 'Width of the generated image (default: 1024)'
      },
      height: {
        type: 'number',
        description: 'Height of the generated image (default: 1024)'
      },
      enhance: {
        type: 'boolean',
        description: 'Whether to enhance the prompt using an LLM before generating (default: true)'
      },
      safe: {
        type: 'boolean',
        description: 'Whether to apply content filtering (default: false)'
      },
      transparent: {
        type: 'boolean',
        description: 'Generate image with transparent background (gptimage model only, default: false)'
      }
    },
    required: ['prompt']
  }
};

/**
 * Schema for the generateImage tool
 */
export const generateImageSchema = {
  name: 'generateImage',
  description: 'Generate an image, return the base64-encoded data, and save to a file by default. User-configured settings in MCP config will be used as defaults unless specifically overridden.',
  inputSchema: {
    type: 'object',
    properties: {
      prompt: {
        type: 'string',
        description: 'The text description of the image to generate'
      },
      model: {
        type: 'string',
        description: 'Model name to use for generation (default: user config or "flux"). Use listImageModels to see all available models'
      },
      seed: {
        type: 'number',
        description: 'Seed for reproducible results (default: random)'
      },
      width: {
        type: 'number',
        description: 'Width of the generated image (default: 1024)'
      },
      height: {
        type: 'number',
        description: 'Height of the generated image (default: 1024)'
      },
      enhance: {
        type: 'boolean',
        description: 'Whether to enhance the prompt using an LLM before generating (default: true)'
      },
      safe: {
        type: 'boolean',
        description: 'Whether to apply content filtering (default: false)'
      },
      transparent: {
        type: 'boolean',
        description: 'Generate image with transparent background (gptimage model only, default: false)'
      },
      outputPath: {
        type: 'string',
        description: 'Directory path where to save the image (default: "./mcpollinations-output")'
      },
      fileName: {
        type: 'string',
        description: 'Name of the file to save (without extension, default: generated from prompt)'
      },
      format: {
        type: 'string',
        description: 'Image format to save as (png, jpeg, jpg, webp - default: png)'
      }
    },
    required: ['prompt']
  }
};

/**
 * Schema for the listImageModels tool
 */
export const listImageModelsSchema = {
  name: 'listImageModels',
  description: 'List available image models',
  inputSchema: {
    type: 'object',
    properties: {}
  }
};

/**
 * Schema for the editImage tool
 */
export const editImageSchema = {
  name: 'editImage',
  description: 'Edit or modify an existing image based on a text prompt. User-configured settings in MCP config will be used as defaults unless specifically overridden.',
  inputSchema: {
    type: 'object',
    properties: {
      prompt: {
        type: 'string',
        description: 'The text description of how to edit the image (e.g., "remove the cat and add a dog", "change background to mountains")'
      },
      imageUrl: {
        type: 'string',
        description: 'URL of the input image to edit'
      },
      model: {
        type: 'string',
        description: 'Model name to use for editing (default: user config or "gptimage"). Available: "gptimage", "kontext"'
      },
      seed: {
        type: 'number',
        description: 'Seed for reproducible results (default: random)'
      },
      width: {
        type: 'number',
        description: 'Width of the generated image (default: 1024)'
      },
      height: {
        type: 'number',
        description: 'Height of the generated image (default: 1024)'
      },
      enhance: {
        type: 'boolean',
        description: 'Whether to enhance the prompt using an LLM before generating (default: true)'
      },
      safe: {
        type: 'boolean',
        description: 'Whether to apply content filtering (default: false)'
      },
      transparent: {
        type: 'boolean',
        description: 'Generate image with transparent background (gptimage model only, default: false)'
      },
      outputPath: {
        type: 'string',
        description: 'Directory path where to save the image (default: user config or "./mcpollinations-output")'
      },
      fileName: {
        type: 'string',
        description: 'Name of the file to save (without extension, default: generated from prompt)'
      },
      format: {
        type: 'string',
        description: 'Image format to save as (png, jpeg, jpg, webp - default: png)'
      }
    },
    required: ['prompt', 'imageUrl']
  }
};

/**
 * Schema for the generateImageFromReference tool
 */
export const generateImageFromReferenceSchema = {
  name: 'generateImageFromReference',
  description: 'Generate a new image using an existing image as reference. User-configured settings in MCP config will be used as defaults unless specifically overridden.',
  inputSchema: {
    type: 'object',
    properties: {
      prompt: {
        type: 'string',
        description: 'The text description of what to generate based on the reference image (e.g., "create a cartoon version", "make it look like a painting")'
      },
      imageUrl: {
        type: 'string',
        description: 'URL of the reference image to base the generation on'
      },
      model: {
        type: 'string',
        description: 'Model name to use for generation (default: user config or "gptimage"). Available: "gptimage", "kontext"'
      },
      seed: {
        type: 'number',
        description: 'Seed for reproducible results (default: random)'
      },
      width: {
        type: 'number',
        description: 'Width of the generated image (default: 1024)'
      },
      height: {
        type: 'number',
        description: 'Height of the generated image (default: 1024)'
      },
      enhance: {
        type: 'boolean',
        description: 'Whether to enhance the prompt using an LLM before generating (default: true)'
      },
      safe: {
        type: 'boolean',
        description: 'Whether to apply content filtering (default: false)'
      },
      transparent: {
        type: 'boolean',
        description: 'Generate image with transparent background (gptimage model only, default: false)'
      },
      outputPath: {
        type: 'string',
        description: 'Directory path where to save the image (default: user config or "./mcpollinations-output")'
      },
      fileName: {
        type: 'string',
        description: 'Name of the file to save (without extension, default: generated from prompt)'
      },
      format: {
        type: 'string',
        description: 'Image format to save as (png, jpeg, jpg, webp - default: png)'
      }
    },
    required: ['prompt', 'imageUrl']
  }
};