Skip to main content
Glama

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
NameRequiredDescriptionDefault
predictionIdYesID of the prediction to retrieve

Implementation Reference

  • 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); } };
  • 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 );
  • 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>;

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/awkoy/replicate-flux-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server