Skip to content

Conversation

FinestMaximus
Copy link

@FinestMaximus FinestMaximus commented Sep 5, 2025

What kind of change does this PR introduce?

Bug fix - Fixes MCP tool ignoring the images array parameter when scheduling posts.

Why was this change needed?

This change fixes issue #856 where the POSTIZ_SCHEDULE_POST MCP tool was completely ignoring the images array parameter, causing posts to be created without any provided images.

Root Causes Fixed:

  1. Type Inconsistency: The zod schema defined type: eenum(['draft', 'scheduled']) but the TypeScript interface used 'draft' | 'schedule', and the actual API expects 'schedule' not 'scheduled'.

  2. Missing Images Interface: The TypeScript interface only defined posts: { text: string }[] but the zod schema expected images: array(string()) as well.

  3. Images Array Completely Ignored: The implementation only handled AI-generated images when generatePictures=true, but never used any images provided in the images array parameter.

Changes Made:

  • Fixed type consistency by changing 'scheduled' to 'schedule' in zod schema
  • Added images: string[] to the TypeScript interface
  • Implemented priority-based image handling:
    • Priority 1: Use provided images from images array if available
    • Priority 2: Generate AI images if generatePictures=true and no images provided
    • Priority 3: Empty array if neither condition is met

This ensures that when users call the MCP tool with images, those images are actually included in the post instead of being silently ignored.

Other information:

This is a straightforward bug fix that doesn't change the API surface - it just makes the existing images parameter work as documented. No breaking changes, and maintains backward compatibility with existing usage patterns.

The fix ensures that the MCP tool now works correctly for users who want to include specific images in their social media posts, which is a core functionality that was previously broken.

Checklist:

Put a "X" in the boxes below to indicate you have followed the checklist;

  • I have read the CONTRIBUTING guide.
  • I checked that there were not similar issues or PRs already open for this.
  • This PR fixes just ONE issue (do not include multiple issues or types of change in the same PR) For example, don't try and fix a UI issue and include new dependencies in the same PR.

Copy link

vercel bot commented Sep 5, 2025

@FinestMaximus is attempting to deploy a commit to the Listinai Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant