Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat(mcp): expose the curated post error in the posts list tool

Gilad Resisi8202a150a128
diff --git a/libraries/nestjs-libraries/src/chat/tools/posts.list.tool.ts b/libraries/nestjs-libraries/src/chat/tools/posts.list.tool.ts
index a22ed040f..2dc3644d1 100644
--- a/libraries/nestjs-libraries/src/chat/tools/posts.list.tool.ts
+++ b/libraries/nestjs-libraries/src/chat/tools/posts.list.tool.ts
@@ -38,7 +38,7 @@ export class PostsListTool implements AgentToolInterface {
List the organization's posts scheduled to be published between two dates (the same data as the "List Posts" API endpoint).
Returns every post in the window whatever its state (scheduled, draft, published, errored).
"startDate" and "endDate" are required (UTC) - to list all upcoming posts, pass a wide window (for example from now to a year ahead).
-Each item has an "id", its publish date, state, content, channel and current provider settings.
+Each item has an "id", its publish date, state, error (for errored posts), content, channel and current provider settings.
Posts cannot be deleted through the Postiz tools - if the user wants to delete a post, tell them to do it themselves in the Postiz app; never offer to delete a post.
`,
inputSchema: z.object({
@@ -62,6 +62,12 @@ Posts cannot be deleted through the Postiz tools - if the user wants to delete a
.describe('The post id'),
publishDate: z.string().describe('UTC time'),
state: z.string().describe('QUEUE, DRAFT, PUBLISHED or ERROR'),
+ error: z
+ .string()
+ .nullable()
+ .describe(
+ 'Curated failure message for errored posts, null otherwise'
+ ),
content: z.string(),
settings: z
.any()
@@ -94,6 +100,7 @@ Posts cannot be deleted through the Postiz tools - if the user wants to delete a
.utc()
.format('YYYY-MM-DDTHH:mm:ss'),
state: p.state,
+ error: p.error ?? null,
content: p.content || '',
settings: parseSettings(p.settings),
group: p.group,