update_blog
Update blog post metadata including name, URL path, and SEO settings for a specific website.
Instructions
Update blog post metadata.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| website_id | Yes | The website ID | |
| blog_id | Yes | The blog post ID | |
| name | No | Blog name | |
| path | No | URL path | |
| seo | No | SEO settings object |
Implementation Reference
- server/index.js:677-696 (registration)Registration of the 'update_blog' tool using server.tool()
server.tool( "update_blog", "Update blog post metadata.", { website_id: z.string().describe("The website ID"), blog_id: z.string().describe("The blog post ID"), name: z.string().optional().describe("Blog name"), path: z.string().optional().describe("URL path"), seo: z.record(z.unknown()).optional().describe("SEO settings object"), }, { title: "Update Blog", readOnlyHint: false, destructiveHint: false, openWorldHint: false }, async ({ website_id, blog_id, name, path, seo }) => { const body = {}; if (name) body.name = name; if (path) body.path = path; if (seo) body.seo = seo; const data = await apiCall(`/v1/workspace/website/${website_id}/blogs/${blog_id}`, "PATCH", body); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } ); - server/index.js:680-686 (schema)Input schema for update_blog: website_id, blog_id, optional name/path/seo
{ website_id: z.string().describe("The website ID"), blog_id: z.string().describe("The blog post ID"), name: z.string().optional().describe("Blog name"), path: z.string().optional().describe("URL path"), seo: z.record(z.unknown()).optional().describe("SEO settings object"), }, - server/index.js:688-695 (handler)Handler function that builds the request body and calls the PATCH API endpoint
async ({ website_id, blog_id, name, path, seo }) => { const body = {}; if (name) body.name = name; if (path) body.path = path; if (seo) body.seo = seo; const data = await apiCall(`/v1/workspace/website/${website_id}/blogs/${blog_id}`, "PATCH", body); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } - server/index.js:112-123 (helper)The apiCall helper function used by the handler to make HTTP requests
async function apiCall(path, method, body) { const url = `${BASE_URL}${path}`; const res = await fetch(url, { method, headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json", }, ...(body ? { body: JSON.stringify(body) } : {}), }); return res.json(); }