Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bug: mcp image handling bug https://github.com/gitroomhq/postiz-app/issues/856 #968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
FinestMaximus wants to merge 1 commit into gitroomhq:main
base: main
Choose a base branch
Loading
from FinestMaximus:mcp-images-856

Conversation

@FinestMaximus
Copy link

@FinestMaximus FinestMaximus commented Sep 5, 2025
edited
Loading

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.

Copy link

Thank you for working on this! I'm experiencing a similar but different error (object found, string expected) when posting images to X via the UI. Hoping this fix gets merged soon!

FinestMaximus reacted with heart emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /