bug: mcp image handling bug https://github.com/gitroomhq/postiz-app/issues/856 #968
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theimages
array parameter, causing posts to be created without any provided images.Root Causes Fixed:
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'
.Missing Images Interface: The TypeScript interface only defined
posts: { text: string }[]
but the zod schema expectedimages: array(string())
as well.Images Array Completely Ignored: The implementation only handled AI-generated images when
generatePictures=true
, but never used any images provided in theimages
array parameter.Changes Made:
'scheduled'
to'schedule'
in zod schemaimages: string[]
to the TypeScript interfaceimages
array if availablegeneratePictures=true
and no images providedThis 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;