update_post
Modify existing feedback posts in Canny by updating titles, descriptions, categories, status, or custom fields to keep customer feedback current and organized.
Instructions
Update an existing Canny post
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| categoryId | No | New category ID for the post (optional) | |
| customFields | No | Updated custom field values (optional) | |
| details | No | New description for the post (optional) | |
| postId | Yes | ID of the post to update | |
| status | No | New status for the post (optional) | |
| title | No | New title for the post (optional) |
Implementation Reference
- src/tools/posts.ts:282-332 (handler)The complete implementation of the update_post tool, including schema definition, handler logic that validates input, calls the Canny client to update the post, handles errors, and formats the response.export const updatePostTool = { name: 'update_post', description: 'Update an existing Canny post', inputSchema: { type: 'object', properties: { postId: { type: 'string', description: 'ID of the post to update' }, title: { type: 'string', description: 'New title for the post (optional)' }, details: { type: 'string', description: 'New description for the post (optional)' }, categoryId: { type: 'string', description: 'New category ID for the post (optional)' }, customFields: { type: 'object', description: 'Updated custom field values (optional)', additionalProperties: true }, status: { type: 'string', enum: ['open', 'under review', 'planned', 'in progress', 'complete', 'closed'], description: 'New status for the post (optional)' }, }, required: ['postId'], additionalProperties: false, }, handler: async (args: unknown, client: CannyClient) => { const { postId, title, details, categoryId, customFields, status } = validateToolInput<UpdatePostInput>(args, UpdatePostSchema); const response = await client.updatePost(postId, { title, details, categoryID: categoryId, customFields, status, }); if (response.error) { throw new Error(`Failed to update post: ${response.error}`); } if (!response.data) { return 'Post update failed - no data returned'; } const post = response.data; return `Successfully updated post!\n\n` + `**${post.title}** (ID: ${post.id})\n` + `Status: ${post.status}\n` + `Updated: ${new Date(post.updatedAt).toLocaleString()}\n` + `URL: ${post.url}`; }, };
- src/tools/posts.ts:34-47 (schema)Zod schema (UpdatePostSchema) and TypeScript type (UpdatePostInput) for input validation of the update_post tool.const UpdatePostSchema = z.object({ postId: z.string().min(1, 'Post ID is required'), title: z.string().optional(), details: z.string().optional(), categoryId: z.string().optional(), customFields: z.record(z.any()).optional(), status: z.enum(['open', 'under review', 'planned', 'in progress', 'complete', 'closed']).optional(), }); type GetPostsInput = z.infer<typeof GetPostsSchema>; type GetPostInput = z.infer<typeof GetPostSchema>; type SearchPostsInput = z.infer<typeof SearchPostsSchema>; type CreatePostInput = z.infer<typeof CreatePostSchema>; type UpdatePostInput = z.infer<typeof UpdatePostSchema>;
- src/tools/index.ts:29-45 (registration)Registration of the update_post tool (as updatePostTool) in the main tools array exported for use in the MCP server.export const tools: Tool[] = [ // Board management getBoardsTool, // Post management getPostsTool, getPostTool, searchPostsTool, createPostTool, updatePostTool, // Extended functionality - temporarily disabled for debugging // getCategoresTool, // getCommentsTool, // getUsersTool, // getTagsTool, ];
- src/tools/index.ts:48-59 (registration)Individual export of updatePostTool for testing and potential direct use.export { getBoardsTool, getPostsTool, getPostTool, searchPostsTool, createPostTool, updatePostTool, // getCategoresTool, // getCommentsTool, // getUsersTool, // getTagsTool, };