crisp_upscale
Enhance image clarity and sharpness with Recraft AI MCP Server's upscale tool. Input a local file or URL to receive a higher-quality, upscaled image and preview.
Instructions
Crisp upscale of the input image using Recraft. This operation takes an input image and returns an upscaled image, making the image sharper and cleaner. This version of upscale is much cheaper and faster than creative upscale. Local path or URL to resulting image and its preview will be returned in the response.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| imageURI | Yes | Image to use as an input. This can be a URL (starting with http:// or https://) or an absolute file path (starting with file://). |
Implementation Reference
- src/tools/CrispUpscale.ts:23-49 (handler)The main handler function for the crisp_upscale tool. Downloads the input image, calls the Recraft API's crispUpscale method, and returns the result formatted for MCP.export const crispUpscaleHandler = async (server: RecraftServer, args: Record<string, unknown>): Promise<CallToolResult> => { try { const { imageURI } = z.object({ imageURI: z.string(), }).parse(args) const imageData = await downloadImage(imageURI) const result = await server.api.imageApi.crispUpscale({ image: await imageDataToBlob(imageData), responseFormat: 'url', expire: server.isLocalResultsStorage, }) return await server.transformSingleImageOperationToCallToolResult(result.image, 'Crisp upscale completed.') } catch (error) { return { content: [ { type: 'text', text: `Crisp upscale error: ${error}` } ], isError: true } } }
- src/tools/CrispUpscale.ts:8-21 (schema)Tool definition including name, description, and input schema for validation.export const crispUpscaleTool = { name: "crisp_upscale", description: "Crisp upscale of the input image using Recraft.\n" + "This operation takes an input image and returns an upscaled image, making the image sharper and cleaner.\n" + "This version of upscale is much cheaper and faster than creative upscale.\n" + "Local path or URL to resulting image and its preview will be returned in the response.", inputSchema: { type: "object", properties: { imageURI: PARAMETERS.imageURI, }, required: ["imageURI"] } }
- src/index.ts:68-82 (registration)Registration of crispUpscaleTool in the MCP server's list of available tools.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ generateImageTool, createStyleTool, vectorizeImageTool, imageToImageTool, removeBackgroundTool, replaceBackgroundTool, crispUpscaleTool, creativeUpscaleTool, getUserTool, ], } })
- src/index.ts:114-115 (registration)Dispatch to crispUpscaleHandler in the MCP call tool request handler switch statement.case crispUpscaleTool.name: return await crispUpscaleHandler(recraftServer, args ?? {})
- src/api/apis/ImageApi.ts:66-71 (schema)TypeScript interface defining the request schema for the underlying Recraft API crispUpscale endpoint.export interface CrispUpscaleRequest { image: Blob; expire?: boolean; imageFormat?: ImageFormat; responseFormat?: ResponseFormat; }