@meshy-ai/meshy-mcp-server 0.2.0

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.
Files changed (58) hide show
  1. package/.env.example +14 -0
  2. package/LICENSE +21 -0
  3. package/README.md +108 -0
  4. package/dist/constants.d.ts +123 -0
  5. package/dist/constants.js +169 -0
  6. package/dist/index.d.ts +8 -0
  7. package/dist/index.js +130 -0
  8. package/dist/instructions.d.ts +6 -0
  9. package/dist/instructions.js +90 -0
  10. package/dist/schemas/balance.d.ts +11 -0
  11. package/dist/schemas/balance.js +8 -0
  12. package/dist/schemas/common.d.ts +38 -0
  13. package/dist/schemas/common.js +52 -0
  14. package/dist/schemas/generation.d.ts +219 -0
  15. package/dist/schemas/generation.js +217 -0
  16. package/dist/schemas/image.d.ts +55 -0
  17. package/dist/schemas/image.js +46 -0
  18. package/dist/schemas/output.d.ts +75 -0
  19. package/dist/schemas/output.js +41 -0
  20. package/dist/schemas/postprocessing.d.ts +135 -0
  21. package/dist/schemas/postprocessing.js +123 -0
  22. package/dist/schemas/printing.d.ts +63 -0
  23. package/dist/schemas/printing.js +54 -0
  24. package/dist/schemas/tasks.d.ts +123 -0
  25. package/dist/schemas/tasks.js +85 -0
  26. package/dist/services/error-handler.d.ts +32 -0
  27. package/dist/services/error-handler.js +141 -0
  28. package/dist/services/file-utils.d.ts +15 -0
  29. package/dist/services/file-utils.js +55 -0
  30. package/dist/services/meshy-client.d.ts +54 -0
  31. package/dist/services/meshy-client.js +172 -0
  32. package/dist/services/output-manager.d.ts +52 -0
  33. package/dist/services/output-manager.js +284 -0
  34. package/dist/tools/balance.d.ts +9 -0
  35. package/dist/tools/balance.js +61 -0
  36. package/dist/tools/generation.d.ts +9 -0
  37. package/dist/tools/generation.js +419 -0
  38. package/dist/tools/image.d.ts +9 -0
  39. package/dist/tools/image.js +154 -0
  40. package/dist/tools/postprocessing.d.ts +9 -0
  41. package/dist/tools/postprocessing.js +405 -0
  42. package/dist/tools/printing.d.ts +9 -0
  43. package/dist/tools/printing.js +338 -0
  44. package/dist/tools/tasks.d.ts +9 -0
  45. package/dist/tools/tasks.js +1074 -0
  46. package/dist/tools/workspace.d.ts +9 -0
  47. package/dist/tools/workspace.js +161 -0
  48. package/dist/types.d.ts +261 -0
  49. package/dist/types.js +4 -0
  50. package/dist/utils/endpoints.d.ts +16 -0
  51. package/dist/utils/endpoints.js +38 -0
  52. package/dist/utils/request-builder.d.ts +15 -0
  53. package/dist/utils/request-builder.js +24 -0
  54. package/dist/utils/response-formatter.d.ts +27 -0
  55. package/dist/utils/response-formatter.js +37 -0
  56. package/dist/utils/slicer-detector.d.ts +29 -0
  57. package/dist/utils/slicer-detector.js +237 -0
  58. package/package.json +64 -0
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Zod schema for balance tool
3
+ */
4
+ import { z } from "zod";
5
+ export declare const CheckBalanceInputSchema: z.ZodObject<{
6
+ response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
7
+ }, "strict", z.ZodTypeAny, {
8
+ response_format: import("../constants.js").ResponseFormat;
9
+ }, {
10
+ response_format?: import("../constants.js").ResponseFormat | undefined;
11
+ }>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Zod schema for balance tool
3
+ */
4
+ import { z } from "zod";
5
+ import { ResponseFormatSchema } from "./common.js";
6
+ export const CheckBalanceInputSchema = z.object({
7
+ response_format: ResponseFormatSchema
8
+ }).strict();
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Common Zod schemas shared across tools
3
+ */
4
+ import { z } from "zod";
5
+ import { ResponseFormat, TaskType } from "../constants.js";
6
+ /**
7
+ * Response format schema
8
+ */
9
+ export declare const ResponseFormatSchema: z.ZodDefault<z.ZodNativeEnum<typeof ResponseFormat>>;
10
+ /**
11
+ * Pagination schema
12
+ */
13
+ export declare const PaginationSchema: z.ZodObject<{
14
+ limit: z.ZodDefault<z.ZodNumber>;
15
+ offset: z.ZodDefault<z.ZodNumber>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ limit: number;
18
+ offset: number;
19
+ }, {
20
+ limit?: number | undefined;
21
+ offset?: number | undefined;
22
+ }>;
23
+ /**
24
+ * Task ID schema
25
+ */
26
+ export declare const TaskIdSchema: z.ZodString;
27
+ /**
28
+ * URL schema
29
+ */
30
+ export declare const UrlSchema: z.ZodString;
31
+ /**
32
+ * Prompt schema
33
+ */
34
+ export declare const PromptSchema: z.ZodString;
35
+ /**
36
+ * Task type schema
37
+ */
38
+ export declare const TaskTypeSchema: z.ZodDefault<z.ZodNativeEnum<typeof TaskType>>;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Common Zod schemas shared across tools
3
+ */
4
+ import { z } from "zod";
5
+ import { ResponseFormat, TaskType } from "../constants.js";
6
+ /**
7
+ * Response format schema
8
+ */
9
+ export const ResponseFormatSchema = z.nativeEnum(ResponseFormat)
10
+ .default(ResponseFormat.MARKDOWN)
11
+ .describe("Output format: 'markdown' for human-readable or 'json' for machine-readable");
12
+ /**
13
+ * Pagination schema
14
+ */
15
+ export const PaginationSchema = z.object({
16
+ limit: z.number()
17
+ .int()
18
+ .min(1, "Limit must be at least 1")
19
+ .max(100, "Limit cannot exceed 100")
20
+ .default(20)
21
+ .describe("Maximum number of results to return"),
22
+ offset: z.number()
23
+ .int()
24
+ .min(0, "Offset cannot be negative")
25
+ .default(0)
26
+ .describe("Number of results to skip for pagination")
27
+ });
28
+ /**
29
+ * Task ID schema
30
+ */
31
+ export const TaskIdSchema = z.string()
32
+ .min(1, "Task ID is required")
33
+ .describe("Unique task identifier (UUID)");
34
+ /**
35
+ * URL schema
36
+ */
37
+ export const UrlSchema = z.string()
38
+ .url("Must be a valid URL")
39
+ .describe("Publicly accessible URL");
40
+ /**
41
+ * Prompt schema
42
+ */
43
+ export const PromptSchema = z.string()
44
+ .min(2, "Prompt must be at least 2 characters")
45
+ .max(600, "Prompt must not exceed 600 characters")
46
+ .describe("Text description");
47
+ /**
48
+ * Task type schema
49
+ */
50
+ export const TaskTypeSchema = z.nativeEnum(TaskType)
51
+ .default(TaskType.TEXT_TO_3D)
52
+ .describe("Task type to determine correct API endpoint. Defaults to 'text-to-3d'");
@@ -0,0 +1,219 @@
1
+ /**
2
+ * Zod schemas for generation tools
3
+ */
4
+ import { z } from "zod";
5
+ import { AIModel, ModelType, SymmetryMode, Topology, PoseMode } from "../constants.js";
6
+ /**
7
+ * Text-to-3D input schema
8
+ */
9
+ export declare const TextTo3DInputSchema: z.ZodObject<{
10
+ prompt: z.ZodString;
11
+ ai_model: z.ZodDefault<z.ZodNativeEnum<typeof AIModel>>;
12
+ model_type: z.ZodOptional<z.ZodNativeEnum<typeof ModelType>>;
13
+ topology: z.ZodOptional<z.ZodNativeEnum<typeof Topology>>;
14
+ target_polycount: z.ZodOptional<z.ZodNumber>;
15
+ symmetry_mode: z.ZodOptional<z.ZodNativeEnum<typeof SymmetryMode>>;
16
+ should_remesh: z.ZodOptional<z.ZodBoolean>;
17
+ pose_mode: z.ZodOptional<z.ZodNativeEnum<typeof PoseMode>>;
18
+ target_formats: z.ZodOptional<z.ZodArray<z.ZodEnum<["glb", "obj", "fbx", "stl", "usdz", "3mf"]>, "many">>;
19
+ auto_size: z.ZodOptional<z.ZodBoolean>;
20
+ origin_at: z.ZodOptional<z.ZodEnum<["bottom", "center"]>>;
21
+ response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
22
+ }, "strict", z.ZodTypeAny, {
23
+ prompt: string;
24
+ ai_model: AIModel;
25
+ response_format: import("../constants.js").ResponseFormat;
26
+ model_type?: ModelType | undefined;
27
+ topology?: Topology | undefined;
28
+ target_polycount?: number | undefined;
29
+ symmetry_mode?: SymmetryMode | undefined;
30
+ should_remesh?: boolean | undefined;
31
+ pose_mode?: PoseMode | undefined;
32
+ target_formats?: ("glb" | "fbx" | "usdz" | "3mf" | "obj" | "stl")[] | undefined;
33
+ auto_size?: boolean | undefined;
34
+ origin_at?: "bottom" | "center" | undefined;
35
+ }, {
36
+ prompt: string;
37
+ ai_model?: AIModel | undefined;
38
+ model_type?: ModelType | undefined;
39
+ topology?: Topology | undefined;
40
+ target_polycount?: number | undefined;
41
+ symmetry_mode?: SymmetryMode | undefined;
42
+ should_remesh?: boolean | undefined;
43
+ pose_mode?: PoseMode | undefined;
44
+ target_formats?: ("glb" | "fbx" | "usdz" | "3mf" | "obj" | "stl")[] | undefined;
45
+ auto_size?: boolean | undefined;
46
+ origin_at?: "bottom" | "center" | undefined;
47
+ response_format?: import("../constants.js").ResponseFormat | undefined;
48
+ }>;
49
+ /**
50
+ * Image-to-3D input schema
51
+ */
52
+ export declare const ImageTo3DInputSchema: z.ZodObject<{
53
+ image_url: z.ZodOptional<z.ZodString>;
54
+ file_path: z.ZodOptional<z.ZodString>;
55
+ ai_model: z.ZodDefault<z.ZodNativeEnum<typeof AIModel>>;
56
+ model_type: z.ZodOptional<z.ZodNativeEnum<typeof ModelType>>;
57
+ pose_mode: z.ZodOptional<z.ZodNativeEnum<typeof PoseMode>>;
58
+ enable_pbr: z.ZodDefault<z.ZodBoolean>;
59
+ topology: z.ZodOptional<z.ZodNativeEnum<typeof Topology>>;
60
+ target_polycount: z.ZodOptional<z.ZodNumber>;
61
+ should_remesh: z.ZodOptional<z.ZodBoolean>;
62
+ symmetry_mode: z.ZodOptional<z.ZodNativeEnum<typeof SymmetryMode>>;
63
+ should_texture: z.ZodOptional<z.ZodBoolean>;
64
+ texture_prompt: z.ZodOptional<z.ZodString>;
65
+ texture_image_url: z.ZodOptional<z.ZodString>;
66
+ image_enhancement: z.ZodOptional<z.ZodBoolean>;
67
+ remove_lighting: z.ZodDefault<z.ZodBoolean>;
68
+ save_pre_remeshed_model: z.ZodOptional<z.ZodBoolean>;
69
+ target_formats: z.ZodOptional<z.ZodArray<z.ZodEnum<["glb", "obj", "fbx", "stl", "usdz", "3mf"]>, "many">>;
70
+ auto_size: z.ZodOptional<z.ZodBoolean>;
71
+ origin_at: z.ZodOptional<z.ZodEnum<["bottom", "center"]>>;
72
+ response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
73
+ }, "strict", z.ZodTypeAny, {
74
+ ai_model: AIModel;
75
+ response_format: import("../constants.js").ResponseFormat;
76
+ enable_pbr: boolean;
77
+ remove_lighting: boolean;
78
+ model_type?: ModelType | undefined;
79
+ topology?: Topology | undefined;
80
+ target_polycount?: number | undefined;
81
+ symmetry_mode?: SymmetryMode | undefined;
82
+ should_remesh?: boolean | undefined;
83
+ pose_mode?: PoseMode | undefined;
84
+ target_formats?: ("glb" | "fbx" | "usdz" | "3mf" | "obj" | "stl")[] | undefined;
85
+ auto_size?: boolean | undefined;
86
+ origin_at?: "bottom" | "center" | undefined;
87
+ image_url?: string | undefined;
88
+ file_path?: string | undefined;
89
+ should_texture?: boolean | undefined;
90
+ texture_prompt?: string | undefined;
91
+ texture_image_url?: string | undefined;
92
+ image_enhancement?: boolean | undefined;
93
+ save_pre_remeshed_model?: boolean | undefined;
94
+ }, {
95
+ ai_model?: AIModel | undefined;
96
+ model_type?: ModelType | undefined;
97
+ topology?: Topology | undefined;
98
+ target_polycount?: number | undefined;
99
+ symmetry_mode?: SymmetryMode | undefined;
100
+ should_remesh?: boolean | undefined;
101
+ pose_mode?: PoseMode | undefined;
102
+ target_formats?: ("glb" | "fbx" | "usdz" | "3mf" | "obj" | "stl")[] | undefined;
103
+ auto_size?: boolean | undefined;
104
+ origin_at?: "bottom" | "center" | undefined;
105
+ response_format?: import("../constants.js").ResponseFormat | undefined;
106
+ image_url?: string | undefined;
107
+ file_path?: string | undefined;
108
+ enable_pbr?: boolean | undefined;
109
+ should_texture?: boolean | undefined;
110
+ texture_prompt?: string | undefined;
111
+ texture_image_url?: string | undefined;
112
+ image_enhancement?: boolean | undefined;
113
+ remove_lighting?: boolean | undefined;
114
+ save_pre_remeshed_model?: boolean | undefined;
115
+ }>;
116
+ /**
117
+ * Text-to-3D Refine input schema
118
+ */
119
+ export declare const TextTo3DRefineInputSchema: z.ZodObject<{
120
+ preview_task_id: z.ZodString;
121
+ enable_pbr: z.ZodDefault<z.ZodBoolean>;
122
+ texture_prompt: z.ZodOptional<z.ZodString>;
123
+ texture_image_url: z.ZodOptional<z.ZodString>;
124
+ ai_model: z.ZodDefault<z.ZodNativeEnum<typeof AIModel>>;
125
+ remove_lighting: z.ZodDefault<z.ZodBoolean>;
126
+ target_formats: z.ZodOptional<z.ZodArray<z.ZodEnum<["glb", "obj", "fbx", "stl", "usdz", "3mf"]>, "many">>;
127
+ auto_size: z.ZodOptional<z.ZodBoolean>;
128
+ origin_at: z.ZodOptional<z.ZodEnum<["bottom", "center"]>>;
129
+ response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
130
+ }, "strict", z.ZodTypeAny, {
131
+ ai_model: AIModel;
132
+ response_format: import("../constants.js").ResponseFormat;
133
+ enable_pbr: boolean;
134
+ remove_lighting: boolean;
135
+ preview_task_id: string;
136
+ target_formats?: ("glb" | "fbx" | "usdz" | "3mf" | "obj" | "stl")[] | undefined;
137
+ auto_size?: boolean | undefined;
138
+ origin_at?: "bottom" | "center" | undefined;
139
+ texture_prompt?: string | undefined;
140
+ texture_image_url?: string | undefined;
141
+ }, {
142
+ preview_task_id: string;
143
+ ai_model?: AIModel | undefined;
144
+ target_formats?: ("glb" | "fbx" | "usdz" | "3mf" | "obj" | "stl")[] | undefined;
145
+ auto_size?: boolean | undefined;
146
+ origin_at?: "bottom" | "center" | undefined;
147
+ response_format?: import("../constants.js").ResponseFormat | undefined;
148
+ enable_pbr?: boolean | undefined;
149
+ texture_prompt?: string | undefined;
150
+ texture_image_url?: string | undefined;
151
+ remove_lighting?: boolean | undefined;
152
+ }>;
153
+ /**
154
+ * Multi-image-to-3D input schema
155
+ */
156
+ export declare const MultiImageTo3DInputSchema: z.ZodObject<{
157
+ image_urls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
158
+ file_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
159
+ ai_model: z.ZodDefault<z.ZodNativeEnum<typeof AIModel>>;
160
+ model_type: z.ZodOptional<z.ZodNativeEnum<typeof ModelType>>;
161
+ pose_mode: z.ZodOptional<z.ZodNativeEnum<typeof PoseMode>>;
162
+ enable_pbr: z.ZodDefault<z.ZodBoolean>;
163
+ topology: z.ZodOptional<z.ZodNativeEnum<typeof Topology>>;
164
+ target_polycount: z.ZodOptional<z.ZodNumber>;
165
+ should_remesh: z.ZodOptional<z.ZodBoolean>;
166
+ symmetry_mode: z.ZodOptional<z.ZodNativeEnum<typeof SymmetryMode>>;
167
+ should_texture: z.ZodOptional<z.ZodBoolean>;
168
+ texture_prompt: z.ZodOptional<z.ZodString>;
169
+ texture_image_url: z.ZodOptional<z.ZodString>;
170
+ image_enhancement: z.ZodOptional<z.ZodBoolean>;
171
+ remove_lighting: z.ZodDefault<z.ZodBoolean>;
172
+ save_pre_remeshed_model: z.ZodOptional<z.ZodBoolean>;
173
+ target_formats: z.ZodOptional<z.ZodArray<z.ZodEnum<["glb", "obj", "fbx", "stl", "usdz", "3mf"]>, "many">>;
174
+ auto_size: z.ZodOptional<z.ZodBoolean>;
175
+ origin_at: z.ZodOptional<z.ZodEnum<["bottom", "center"]>>;
176
+ response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
177
+ }, "strict", z.ZodTypeAny, {
178
+ ai_model: AIModel;
179
+ response_format: import("../constants.js").ResponseFormat;
180
+ enable_pbr: boolean;
181
+ remove_lighting: boolean;
182
+ model_type?: ModelType | undefined;
183
+ topology?: Topology | undefined;
184
+ target_polycount?: number | undefined;
185
+ symmetry_mode?: SymmetryMode | undefined;
186
+ should_remesh?: boolean | undefined;
187
+ pose_mode?: PoseMode | undefined;
188
+ target_formats?: ("glb" | "fbx" | "usdz" | "3mf" | "obj" | "stl")[] | undefined;
189
+ auto_size?: boolean | undefined;
190
+ origin_at?: "bottom" | "center" | undefined;
191
+ should_texture?: boolean | undefined;
192
+ texture_prompt?: string | undefined;
193
+ texture_image_url?: string | undefined;
194
+ image_enhancement?: boolean | undefined;
195
+ save_pre_remeshed_model?: boolean | undefined;
196
+ image_urls?: string[] | undefined;
197
+ file_paths?: string[] | undefined;
198
+ }, {
199
+ ai_model?: AIModel | undefined;
200
+ model_type?: ModelType | undefined;
201
+ topology?: Topology | undefined;
202
+ target_polycount?: number | undefined;
203
+ symmetry_mode?: SymmetryMode | undefined;
204
+ should_remesh?: boolean | undefined;
205
+ pose_mode?: PoseMode | undefined;
206
+ target_formats?: ("glb" | "fbx" | "usdz" | "3mf" | "obj" | "stl")[] | undefined;
207
+ auto_size?: boolean | undefined;
208
+ origin_at?: "bottom" | "center" | undefined;
209
+ response_format?: import("../constants.js").ResponseFormat | undefined;
210
+ enable_pbr?: boolean | undefined;
211
+ should_texture?: boolean | undefined;
212
+ texture_prompt?: string | undefined;
213
+ texture_image_url?: string | undefined;
214
+ image_enhancement?: boolean | undefined;
215
+ remove_lighting?: boolean | undefined;
216
+ save_pre_remeshed_model?: boolean | undefined;
217
+ image_urls?: string[] | undefined;
218
+ file_paths?: string[] | undefined;
219
+ }>;
@@ -0,0 +1,217 @@
1
+ /**
2
+ * Zod schemas for generation tools
3
+ */
4
+ import { z } from "zod";
5
+ import { AIModel, ModelType, SymmetryMode, Topology, PoseMode } from "../constants.js";
6
+ /**
7
+ * Shared target_formats schema.
8
+ * 3MF is NOT included in default output — must be explicitly requested.
9
+ */
10
+ const TargetFormatsSchema = z.array(z.enum(["glb", "obj", "fbx", "stl", "usdz", "3mf"]))
11
+ .optional()
12
+ .describe("Output formats to generate. When omitted, produces glb/obj/fbx/stl/usdz but NOT 3mf. To get 3MF, you MUST include '3mf' explicitly (e.g. [\"glb\", \"3mf\"]). Specifying formats can reduce task completion time.");
13
+ import { ResponseFormatSchema, PromptSchema, UrlSchema } from "./common.js";
14
+ /**
15
+ * Text-to-3D input schema
16
+ */
17
+ export const TextTo3DInputSchema = z.object({
18
+ prompt: PromptSchema,
19
+ ai_model: z.nativeEnum(AIModel)
20
+ .default(AIModel.LATEST)
21
+ .describe("AI model: 'meshy-5', 'meshy-6', or 'latest' (default, currently resolves to Meshy 6). IMPORTANT: Before calling this tool, ask the user which model to use and explain the differences: meshy-6/latest = best quality (20 credits), meshy-5 = previous gen (5 credits)"),
22
+ model_type: z.nativeEnum(ModelType)
23
+ .optional()
24
+ .describe("Model type: 'standard' or 'lowpoly'. When 'lowpoly', ai_model/topology/target_polycount/should_remesh are ignored"),
25
+ topology: z.nativeEnum(Topology)
26
+ .optional()
27
+ .describe("Mesh topology type (quad or triangle)"),
28
+ target_polycount: z.number()
29
+ .int()
30
+ .min(100, "Polycount must be at least 100")
31
+ .max(300000, "Polycount cannot exceed 300,000")
32
+ .optional()
33
+ .describe("Target polygon count for the model (100–300,000)"),
34
+ symmetry_mode: z.nativeEnum(SymmetryMode)
35
+ .optional()
36
+ .describe("Symmetry mode: 'off', 'auto' (default), or 'on'"),
37
+ should_remesh: z.boolean()
38
+ .optional()
39
+ .describe("Whether to remesh. Default false for meshy-6, true for others"),
40
+ pose_mode: z.nativeEnum(PoseMode)
41
+ .optional()
42
+ .describe("Pose mode for character models: 'a-pose' or 't-pose'. IMPORTANT: When the user intends to rig or animate the model, default to 't-pose' for best rigging results"),
43
+ target_formats: TargetFormatsSchema,
44
+ auto_size: z.boolean()
45
+ .optional()
46
+ .describe("Use AI to auto-estimate real-world height and resize the model. Default false."),
47
+ origin_at: z.enum(["bottom", "center"])
48
+ .optional()
49
+ .describe("Origin position: 'bottom' or 'center'. Default 'bottom' when auto_size is true."),
50
+ response_format: ResponseFormatSchema
51
+ }).strict();
52
+ /**
53
+ * Image-to-3D input schema
54
+ */
55
+ export const ImageTo3DInputSchema = z.object({
56
+ image_url: z.string()
57
+ .optional()
58
+ .describe("PUBLIC image URL (https://...). Use ONLY for remote images. For local files use file_path instead. NEVER manually base64-encode."),
59
+ file_path: z.string()
60
+ .optional()
61
+ .describe("ABSOLUTE path to LOCAL image (.jpg/.png). PREFERRED for local files. Server auto-encodes. Example: /Users/me/photo.jpg. NEVER manually base64-encode."),
62
+ ai_model: z.nativeEnum(AIModel)
63
+ .default(AIModel.LATEST)
64
+ .describe("AI model: 'meshy-5', 'meshy-6', or 'latest' (default, currently resolves to Meshy 6). IMPORTANT: Before calling this tool, ask the user which model to use and explain the differences: meshy-6/latest = best quality (20 credits), meshy-5 = previous gen (5 credits)"),
65
+ model_type: z.nativeEnum(ModelType)
66
+ .optional()
67
+ .describe("Model type: 'standard' or 'lowpoly'"),
68
+ pose_mode: z.nativeEnum(PoseMode)
69
+ .optional()
70
+ .describe("Pose mode for character models: 'a-pose' or 't-pose'. IMPORTANT: When the user intends to rig or animate the model, default to 't-pose' for best rigging results"),
71
+ enable_pbr: z.boolean()
72
+ .default(false)
73
+ .describe("Enable physically-based rendering textures. Default false"),
74
+ topology: z.nativeEnum(Topology)
75
+ .optional()
76
+ .describe("Mesh topology type (quad or triangle)"),
77
+ target_polycount: z.number()
78
+ .int()
79
+ .min(100, "Polycount must be at least 100")
80
+ .max(300000, "Polycount cannot exceed 300,000")
81
+ .optional()
82
+ .describe("Target polygon count for the model (100–300,000)"),
83
+ should_remesh: z.boolean()
84
+ .optional()
85
+ .describe("Whether to remesh. Default false for meshy-6, true for others"),
86
+ symmetry_mode: z.nativeEnum(SymmetryMode)
87
+ .optional()
88
+ .describe("Symmetry mode: 'off', 'auto' (default), or 'on'"),
89
+ should_texture: z.boolean()
90
+ .optional()
91
+ .describe("Whether to generate textures. Default true"),
92
+ texture_prompt: z.string()
93
+ .max(600)
94
+ .optional()
95
+ .describe("Text to guide texturing. Max 600 characters"),
96
+ texture_image_url: UrlSchema
97
+ .optional()
98
+ .describe("Image URL to guide texturing"),
99
+ image_enhancement: z.boolean()
100
+ .optional()
101
+ .describe("Optimize input image for better results. Default true. Meshy-6/latest only"),
102
+ remove_lighting: z.boolean()
103
+ .default(true)
104
+ .describe("Removes highlights and shadows from the base color texture for cleaner results under custom lighting. Default true. Only supported when ai_model is meshy-6 or latest"),
105
+ save_pre_remeshed_model: z.boolean()
106
+ .optional()
107
+ .describe("Store GLB before remeshing. Default false. Only applies when should_remesh is true"),
108
+ target_formats: TargetFormatsSchema,
109
+ auto_size: z.boolean()
110
+ .optional()
111
+ .describe("Use AI to auto-estimate real-world height and resize the model. Default false."),
112
+ origin_at: z.enum(["bottom", "center"])
113
+ .optional()
114
+ .describe("Origin position: 'bottom' or 'center'. Default 'bottom' when auto_size is true."),
115
+ response_format: ResponseFormatSchema
116
+ }).strict();
117
+ /**
118
+ * Text-to-3D Refine input schema
119
+ */
120
+ export const TextTo3DRefineInputSchema = z.object({
121
+ preview_task_id: z.string()
122
+ .min(1, "Preview task ID is required")
123
+ .describe("Task ID of the completed preview task to refine"),
124
+ enable_pbr: z.boolean()
125
+ .default(false)
126
+ .describe("Enable physically-based rendering textures"),
127
+ texture_prompt: z.string()
128
+ .max(600, "Texture prompt must not exceed 600 characters")
129
+ .optional()
130
+ .describe("Text to guide texturing. Max 600 characters"),
131
+ texture_image_url: UrlSchema
132
+ .optional()
133
+ .describe("Image URL to guide texturing"),
134
+ ai_model: z.nativeEnum(AIModel)
135
+ .default(AIModel.LATEST)
136
+ .describe("AI model: 'meshy-5', 'meshy-6', or 'latest' (default, currently resolves to Meshy 6). IMPORTANT: Before calling this tool, ask the user which model to use and explain the differences: meshy-6/latest = best quality (10 credits), meshy-5 = previous gen (10 credits)"),
137
+ remove_lighting: z.boolean()
138
+ .default(true)
139
+ .describe("Removes highlights and shadows from the base color texture for cleaner results under custom lighting. Default true. Only supported when ai_model is meshy-6 or latest"),
140
+ target_formats: TargetFormatsSchema,
141
+ auto_size: z.boolean()
142
+ .optional()
143
+ .describe("Use AI to auto-estimate real-world height and resize the model. Default false."),
144
+ origin_at: z.enum(["bottom", "center"])
145
+ .optional()
146
+ .describe("Origin position: 'bottom' or 'center'. Default 'bottom' when auto_size is true."),
147
+ response_format: ResponseFormatSchema
148
+ }).strict();
149
+ /**
150
+ * Multi-image-to-3D input schema
151
+ */
152
+ export const MultiImageTo3DInputSchema = z.object({
153
+ image_urls: z.array(z.string())
154
+ .min(1)
155
+ .max(4)
156
+ .optional()
157
+ .describe("Array of 1–4 publicly accessible image URLs. Provide this OR file_paths, not both"),
158
+ file_paths: z.array(z.string())
159
+ .min(1)
160
+ .max(4)
161
+ .optional()
162
+ .describe("Array of 1–4 absolute paths to local image files (.jpg, .jpeg, .png). The server reads and encodes them automatically"),
163
+ ai_model: z.nativeEnum(AIModel)
164
+ .default(AIModel.LATEST)
165
+ .describe("AI model: 'meshy-5', 'meshy-6', or 'latest' (default, currently resolves to Meshy 6). IMPORTANT: Before calling this tool, ask the user which model to use and explain the differences: meshy-6/latest = best quality (20 credits), meshy-5 = previous gen (5 credits)"),
166
+ model_type: z.nativeEnum(ModelType)
167
+ .optional()
168
+ .describe("Model type: 'standard' or 'lowpoly'"),
169
+ pose_mode: z.nativeEnum(PoseMode)
170
+ .optional()
171
+ .describe("Pose mode for character models: 'a-pose' or 't-pose'. IMPORTANT: When the user intends to rig or animate the model, default to 't-pose' for best rigging results"),
172
+ enable_pbr: z.boolean()
173
+ .default(false)
174
+ .describe("Enable physically-based rendering textures. Default false"),
175
+ topology: z.nativeEnum(Topology)
176
+ .optional()
177
+ .describe("Mesh topology type (quad or triangle)"),
178
+ target_polycount: z.number()
179
+ .int()
180
+ .min(100, "Polycount must be at least 100")
181
+ .max(300000, "Polycount cannot exceed 300,000")
182
+ .optional()
183
+ .describe("Target polygon count for the model (100–300,000)"),
184
+ should_remesh: z.boolean()
185
+ .optional()
186
+ .describe("Whether to remesh. Default false for meshy-6, true for others"),
187
+ symmetry_mode: z.nativeEnum(SymmetryMode)
188
+ .optional()
189
+ .describe("Symmetry mode: 'off', 'auto' (default), or 'on'"),
190
+ should_texture: z.boolean()
191
+ .optional()
192
+ .describe("Whether to generate textures. Default true"),
193
+ texture_prompt: z.string()
194
+ .max(600)
195
+ .optional()
196
+ .describe("Text to guide texturing. Max 600 characters"),
197
+ texture_image_url: UrlSchema
198
+ .optional()
199
+ .describe("Image URL to guide texturing"),
200
+ image_enhancement: z.boolean()
201
+ .optional()
202
+ .describe("Optimize input images for better results. Default true. Meshy-6/latest only"),
203
+ remove_lighting: z.boolean()
204
+ .default(true)
205
+ .describe("Removes highlights and shadows from the base color texture for cleaner results under custom lighting. Default true. Only supported when ai_model is meshy-6 or latest"),
206
+ save_pre_remeshed_model: z.boolean()
207
+ .optional()
208
+ .describe("Store GLB before remeshing. Default false. Only applies when should_remesh is true"),
209
+ target_formats: TargetFormatsSchema,
210
+ auto_size: z.boolean()
211
+ .optional()
212
+ .describe("Use AI to auto-estimate real-world height and resize the model. Default false."),
213
+ origin_at: z.enum(["bottom", "center"])
214
+ .optional()
215
+ .describe("Origin position: 'bottom' or 'center'. Default 'bottom' when auto_size is true."),
216
+ response_format: ResponseFormatSchema
217
+ }).strict();
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Zod schemas for image generation tools (text-to-image, image-to-image)
3
+ */
4
+ import { z } from "zod";
5
+ import { TextToImageModel, AspectRatio, PoseMode } from "../constants.js";
6
+ /**
7
+ * Text-to-image input schema
8
+ */
9
+ export declare const TextToImageInputSchema: z.ZodObject<{
10
+ ai_model: z.ZodNativeEnum<typeof TextToImageModel>;
11
+ prompt: z.ZodString;
12
+ generate_multi_view: z.ZodDefault<z.ZodBoolean>;
13
+ pose_mode: z.ZodOptional<z.ZodNativeEnum<typeof PoseMode>>;
14
+ aspect_ratio: z.ZodDefault<z.ZodNativeEnum<typeof AspectRatio>>;
15
+ response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
16
+ }, "strict", z.ZodTypeAny, {
17
+ prompt: string;
18
+ ai_model: TextToImageModel;
19
+ response_format: import("../constants.js").ResponseFormat;
20
+ generate_multi_view: boolean;
21
+ aspect_ratio: AspectRatio;
22
+ pose_mode?: PoseMode | undefined;
23
+ }, {
24
+ prompt: string;
25
+ ai_model: TextToImageModel;
26
+ pose_mode?: PoseMode | undefined;
27
+ response_format?: import("../constants.js").ResponseFormat | undefined;
28
+ generate_multi_view?: boolean | undefined;
29
+ aspect_ratio?: AspectRatio | undefined;
30
+ }>;
31
+ /**
32
+ * Image-to-image input schema
33
+ */
34
+ export declare const ImageToImageInputSchema: z.ZodObject<{
35
+ ai_model: z.ZodNativeEnum<typeof TextToImageModel>;
36
+ prompt: z.ZodString;
37
+ reference_image_urls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
38
+ reference_file_paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
39
+ generate_multi_view: z.ZodDefault<z.ZodBoolean>;
40
+ response_format: z.ZodDefault<z.ZodNativeEnum<typeof import("../constants.js").ResponseFormat>>;
41
+ }, "strict", z.ZodTypeAny, {
42
+ prompt: string;
43
+ ai_model: TextToImageModel;
44
+ response_format: import("../constants.js").ResponseFormat;
45
+ generate_multi_view: boolean;
46
+ reference_image_urls?: string[] | undefined;
47
+ reference_file_paths?: string[] | undefined;
48
+ }, {
49
+ prompt: string;
50
+ ai_model: TextToImageModel;
51
+ response_format?: import("../constants.js").ResponseFormat | undefined;
52
+ generate_multi_view?: boolean | undefined;
53
+ reference_image_urls?: string[] | undefined;
54
+ reference_file_paths?: string[] | undefined;
55
+ }>;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Zod schemas for image generation tools (text-to-image, image-to-image)
3
+ */
4
+ import { z } from "zod";
5
+ import { TextToImageModel, AspectRatio, PoseMode } from "../constants.js";
6
+ import { ResponseFormatSchema, PromptSchema } from "./common.js";
7
+ /**
8
+ * Text-to-image input schema
9
+ */
10
+ export const TextToImageInputSchema = z.object({
11
+ ai_model: z.nativeEnum(TextToImageModel)
12
+ .describe("AI model to use for image generation"),
13
+ prompt: PromptSchema,
14
+ generate_multi_view: z.boolean()
15
+ .default(false)
16
+ .describe("Generate multiple viewpoint images (front, side, back)"),
17
+ pose_mode: z.nativeEnum(PoseMode)
18
+ .optional()
19
+ .describe("Pose mode for character images: 'a-pose' or 't-pose'"),
20
+ aspect_ratio: z.nativeEnum(AspectRatio)
21
+ .default(AspectRatio.SQUARE)
22
+ .describe("Aspect ratio of generated image (default: '1:1')"),
23
+ response_format: ResponseFormatSchema
24
+ }).strict();
25
+ /**
26
+ * Image-to-image input schema
27
+ */
28
+ export const ImageToImageInputSchema = z.object({
29
+ ai_model: z.nativeEnum(TextToImageModel)
30
+ .describe("AI model to use for image transformation"),
31
+ prompt: PromptSchema,
32
+ reference_image_urls: z.array(z.string())
33
+ .min(1)
34
+ .max(5)
35
+ .optional()
36
+ .describe("Array of 1–5 publicly accessible reference image URLs. Provide this OR reference_file_paths, not both"),
37
+ reference_file_paths: z.array(z.string())
38
+ .min(1)
39
+ .max(5)
40
+ .optional()
41
+ .describe("Array of 1–5 absolute paths to local reference image files. The server reads and encodes them automatically"),
42
+ generate_multi_view: z.boolean()
43
+ .default(false)
44
+ .describe("Generate multiple viewpoint images (front, side, back)"),
45
+ response_format: ResponseFormatSchema
46
+ }).strict();