publish_blog
Publish a static blog post using markdown content. Provide URL path, title, and optional metadata to create blog entries on your website.
Instructions
Publish a static blog post with markdown content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| website_id | Yes | The website ID | |
| path | Yes | URL path (e.g. /blog/my-post) | |
| blog_content | Yes | Markdown content | |
| page_title | Yes | Blog title | |
| author | No | Author name | |
| excerpt | No | Brief summary | |
| category | No | Category | |
| publish_date | No | Display date |
Implementation Reference
- server/index.js:619-648 (registration)Registration of the 'publish_blog' tool using server.tool(), which defines the schema, metadata, and handler.
server.tool( "publish_blog", "Publish a static blog post with markdown content.", { website_id: z.string().describe("The website ID"), path: z.string().describe("URL path (e.g. /blog/my-post)"), blog_content: z.string().describe("Markdown content"), page_title: z.string().describe("Blog title"), author: z.string().optional().describe("Author name"), excerpt: z.string().optional().describe("Brief summary"), category: z.string().optional().describe("Category"), publish_date: z.string().optional().describe("Display date"), }, { title: "Publish Blog Post", readOnlyHint: false, destructiveHint: false, openWorldHint: true }, async ({ website_id, path, blog_content, page_title, author, excerpt, category, publish_date }) => { const body = { path, blog_content, seo: { page_title }, blog_settings: { ...(author && { author }), ...(excerpt && { excerpt }), ...(category && { category }), ...(publish_date && { publish_date }), }, }; const data = await apiCall(`/v1/workspace/website/${website_id}/blogs/create`, "POST", body); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } ); - server/index.js:622-631 (schema)Input validation schema using Zod for publish_blog, defining all parameters: website_id, path, blog_content, page_title, author, excerpt, category, publish_date.
{ website_id: z.string().describe("The website ID"), path: z.string().describe("URL path (e.g. /blog/my-post)"), blog_content: z.string().describe("Markdown content"), page_title: z.string().describe("Blog title"), author: z.string().optional().describe("Author name"), excerpt: z.string().optional().describe("Brief summary"), category: z.string().optional().describe("Category"), publish_date: z.string().optional().describe("Display date"), }, - server/index.js:633-647 (handler)Handler function for publish_blog that builds the request body and calls the API endpoint POST /v1/workspace/website/{website_id}/blogs/create.
async ({ website_id, path, blog_content, page_title, author, excerpt, category, publish_date }) => { const body = { path, blog_content, seo: { page_title }, blog_settings: { ...(author && { author }), ...(excerpt && { excerpt }), ...(category && { category }), ...(publish_date && { publish_date }), }, }; const data = await apiCall(`/v1/workspace/website/${website_id}/blogs/create`, "POST", body); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } - server/index.js:112-123 (helper)Generic apiCall helper used by the handler to perform authenticated HTTP requests to the Lindo AI API.
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(); }