feat(agent): list posts via a tool aligned with the List Posts API - #1816
Open
giladresisi wants to merge 2 commits into
Open
feat(agent): list posts via a tool aligned with the List Posts API#1816giladresisi wants to merge 2 commits into
giladresisi wants to merge 2 commits into
Conversation
Adds postsListTool (agent / MCP) so an agent can find the org's posts. It calls the same PostsService.getPosts as the public "List Posts" endpoint (GET /public/v1/posts), with the same inputs (startDate, endDate, optional customer) and the same source data, so the tool and the API stay aligned instead of drifting into a separate query. Each item carries the post id (to pass to updatePostSettingsTool), publish date, state, content, channel and current provider settings. Also selects `settings` in getPosts, so both the tool and the public List Posts endpoint now return each post's provider settings (needed to know which posts require a settings change). This adds a `settings` field to the GET /public/v1/posts response. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tomer
getPosts declared the integration relation filter twice in the same where
object: once with { deletedAt: null, organizationId } and again, only when
a customer is passed, with { customerId }. The second key overwrote the
first, so filtering by customer dropped the soft-delete and org checks and
surfaced posts on soft-deleted integrations. Merge customerId into the
single integration filter instead (as getPostsList already does).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
A user scheduled many TikTok posts with the wrong settings and wants an agent to batch-update them — which first requires the agent to find those posts. This adds a list tool for that, aligned with the existing public List Posts endpoint so the two don't drift.
Replaces #1751. That PR accidentally ended up containing the separate update-post-settings work, because its stacked companion (#1752) was merged into its branch instead of into main. This is the clean, list-only version; nothing from either reached main.
What changed
Public API impact
GET /public/v1/posts now returns a settings field on each post. Additive — existing consumers are unaffected.
Testing
Tested end to end: the public API via the CLI + skill, and the agent tools via the internal web-app agent and Claude Code over the remote MCP.
Related
Docs PR: gitroomhq/postiz-docs#232 (documents the new settings field and adds postsListTool to the MCP docs). No postiz-agent change for this PR.