get_prediction
Retrieve detailed information about a specific prediction using its unique ID on the MCP server for Replicate Flux Model.
Instructions
Get details of a specific prediction by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| predictionId | Yes | ID of the prediction to retrieve |
Implementation Reference
- src/tools/getPrediction.ts:6-23 (handler)Handler function that retrieves prediction details by ID from Replicate service and returns as formatted JSON text.export const registerGetPredictionTool = async ({ predictionId, }: GetPredictionParams): Promise<CallToolResult> => { try { const prediction = await replicate.predictions.get(predictionId); return { content: [ { type: "text", text: JSON.stringify(prediction, null, 2), }, ], }; } catch (error) { handleError(error); } };
- src/tools/index.ts:45-50 (registration)Registration of the 'get_prediction' tool using server.tool, providing name, description, schema, and handler.server.tool( "get_prediction", "Get details of a specific prediction by ID", getPredictionSchema, registerGetPredictionTool );
- src/types/index.ts:129-133 (schema)Zod schema definition for get_prediction tool input (predictionId) and corresponding TypeScript type.export const getPredictionSchema = { predictionId: z.string().min(1).describe("ID of the prediction to retrieve"), }; const getPredictionObjectSchema = z.object(getPredictionSchema); export type GetPredictionParams = z.infer<typeof getPredictionObjectSchema>;