Skip to main content
Glama
awkoy

replicate-flux-mcp

prediction_list

Retrieve a list of recent predictions generated by the Replicate Flux Model, using configurable limits to manage output scope.

Instructions

Get a list of recent predictions from Replicate

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of predictions to return

Implementation Reference

  • The main handler function for the 'prediction_list' tool. It fetches a paginated list of predictions from the Replicate service, limits the results based on the input 'limit' parameter, and returns a formatted text response with the count and JSON-serialized predictions.
    export const registerPredictionListTool = async ({
      limit,
    }: PredictionListParams): Promise<CallToolResult> => {
      try {
        const predictions = [];
        for await (const page of replicate.paginate(replicate.predictions.list)) {
          predictions.push(...page);
          if (predictions.length >= limit) {
            break;
          }
        }
    
        const limitedPredictions = predictions.slice(0, limit);
        const totalPages = Math.ceil(predictions.length / limit);
    
        return {
          content: [
            {
              type: "text",
              text: `Found ${limitedPredictions.length} predictions (showing ${limitedPredictions.length} of ${predictions.length} total, page 1 of ${totalPages})`,
            },
            {
              type: "text",
              text: JSON.stringify(limitedPredictions, null, 2),
            },
          ],
        };
      } catch (error) {
        handleError(error);
      }
    };
  • Registration of the 'prediction_list' tool on the MCP server using server.tool(), specifying name, description, schema, and handler.
    server.tool(
      "prediction_list",
      "Get a list of recent predictions from Replicate",
      predictionListSchema,
      registerPredictionListTool
    );
  • Zod schema definition for the 'prediction_list' tool's input parameters, specifically the 'limit' field with validation and description.
    export const predictionListSchema = {
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .default(50)
        .describe("Maximum number of predictions to return"),
    };
    const predictionListObjectSchema = z.object(predictionListSchema);
    export type PredictionListParams = z.infer<typeof predictionListObjectSchema>;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'recent predictions' but doesn't specify timeframes, ordering, pagination, authentication requirements, rate limits, or what constitutes 'recent'. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to understand immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the returned predictions contain, their format, or how 'recent' is defined. Given the lack of structured data, more descriptive context is needed for the agent to use this tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the single parameter 'limit' well-documented in the schema. The description doesn't add any parameter-specific information beyond what the schema already provides, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get a list') and resource ('recent predictions from Replicate'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_prediction' which might retrieve a single prediction, leaving room for ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get_prediction' or 'create_prediction'. The description only states what it does, not when it's appropriate or what distinguishes it from similar tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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