@dondonudonjp/vertexai-imagen-mcp-server
Version:
[DEPRECATED] MCP Server for Vertex AI Imagen image generation. Imagen endpoints shut down 2026-06-30; migrate to the nanoBanana MCP Server (Gemini image models).
29 lines • 1.19 kB
JavaScript
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
export async function startGenerationJob(context, args) {
const { tool_type, params } = args;
if (!tool_type) {
throw new McpError(ErrorCode.InvalidParams, 'tool_type is required (generate|edit|customize|upscale|generate_and_upscale)');
}
if (!params) {
throw new McpError(ErrorCode.InvalidParams, 'params is required');
}
const { jobManager } = context;
try {
const jobId = jobManager.createJob(tool_type, params);
return {
content: [
{
type: 'text',
text: `Job created successfully!\n\nJob ID: ${jobId}\nType: ${tool_type}\nStatus: pending\n\nUse check_job_status to monitor progress and get_job_result to retrieve the output when completed.`,
},
],
};
}
catch (error) {
if (error instanceof McpError) {
throw error;
}
throw new McpError(ErrorCode.InternalError, `Failed to create job: ${error instanceof Error ? error.message : String(error)}`);
}
}
//# sourceMappingURL=startGenerationJob.js.map