generate_article_schema
Creates structured JSON-LD schema markup for articles to enhance search engine visibility and rich results.
Instructions
Generate an Article JSON-LD schema for blog posts, news articles, or other written content.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| headline | Yes | Title of the article | |
| author | No | Author name | |
| datePublished | No | Publication date (ISO 8601 format) | |
| dateModified | No | Last modified date (ISO 8601 format) | |
| image | No | Article image URL | |
| publisher | No | Publisher organization name | |
| description | No | Article summary or excerpt | |
| url | No | URL of the article |
Implementation Reference
- mcp-server/src/index.ts:652-661 (handler)The handler for the 'generate_article_schema' tool, which calls buildArticleSchema and returns the result as JSON.
async (params) => { const schema = buildArticleSchema(params); return { content: [ { type: "text" as const, text: JSON.stringify(schema, null, 2), }, ], }; - mcp-server/src/index.ts:269-302 (helper)The helper function that constructs the Article JSON-LD schema object.
function buildArticleSchema(params: { headline: string; author?: string; datePublished?: string; dateModified?: string; image?: string; publisher?: string; description?: string; url?: string; }): object { const fields: Record<string, unknown> = { headline: params.headline }; if (params.author) { fields.author = { "@type": "Person", name: params.author, }; } if (params.datePublished) fields.datePublished = params.datePublished; if (params.dateModified) fields.dateModified = params.dateModified; if (params.image) fields.image = params.image; if (params.publisher) { fields.publisher = { "@type": "Organization", name: params.publisher, }; } if (params.description) fields.description = params.description; if (params.url) fields.url = params.url; return buildJsonLd("Article", fields); } function buildOrganizationSchema(params: { name: string; url?: string; - mcp-server/src/index.ts:633-651 (registration)The registration of the 'generate_article_schema' tool, including its parameter schema definition.
server.tool( "generate_article_schema", "Generate an Article JSON-LD schema for blog posts, news articles, or other written content.", { headline: z.string().describe("Title of the article"), author: z.string().optional().describe("Author name"), datePublished: z .string() .optional() .describe("Publication date (ISO 8601 format)"), dateModified: z .string() .optional() .describe("Last modified date (ISO 8601 format)"), image: z.string().optional().describe("Article image URL"), publisher: z.string().optional().describe("Publisher organization name"), description: z.string().optional().describe("Article summary or excerpt"), url: z.string().optional().describe("URL of the article"), },