Skip to main content
Glama

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
NameRequiredDescriptionDefault
headlineYesTitle of the article
authorNoAuthor name
datePublishedNoPublication date (ISO 8601 format)
dateModifiedNoLast modified date (ISO 8601 format)
imageNoArticle image URL
publisherNoPublisher organization name
descriptionNoArticle summary or excerpt
urlNoURL of the article

Implementation Reference

  • 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),
          },
        ],
      };
  • 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;
  • 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"),
      },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool generates a schema but doesn't describe what the output looks like (JSON-LD structure), whether it validates inputs, if there are rate limits, authentication requirements, or error conditions. For a tool with 8 parameters and no output schema, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. There's zero wasted text, and it directly communicates the tool's function without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 8 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain the output format (JSON-LD structure), validation behavior, or error handling. While the input schema is well-documented, the lack of output information and behavioral context makes this inadequate for a tool of this complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with all 8 parameters well-documented in the input schema (e.g., 'Title of the article' for headline, 'Publication date (ISO 8601 format)' for datePublished). The description adds no additional parameter information beyond what's in the schema, so it meets the baseline of 3 for high schema coverage without compensating value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Generate an Article JSON-LD schema for blog posts, news articles, or other written content.' It specifies the verb (generate), resource (Article JSON-LD schema), and content types (blog posts, news articles, other written content). However, it doesn't explicitly differentiate from sibling tools like generate_faq_schema or generate_product_schema beyond mentioning 'Article' specifically.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like generate_faq_schema or generate_product_schema, nor does it specify prerequisites, constraints, or typical use cases beyond the generic 'blog posts, news articles, or other written content.'

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sharozdawa/schema-gen'

If you have feedback or need assistance with the MCP directory API, please join our Discord server