Skip to main content
Glama

generate_faq_schema

Generate FAQPage JSON-LD schema markup from question-answer pairs to enhance search visibility and structured data.

Instructions

Generate a FAQPage JSON-LD schema from a list of question-answer pairs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionsYesArray of question-answer pairs

Implementation Reference

  • Implementation of the logic to build the FAQ schema.
    function buildFaqSchema(params: {
      questions: Array<{ question: string; answer: string }>;
    }): object {
      const mainEntity = params.questions.map((q) => ({
        "@type": "Question",
        name: q.question,
        acceptedAnswer: {
          "@type": "Answer",
          text: q.answer,
        },
      }));
    
      return {
        "@context": "https://schema.org",
        "@type": "FAQPage",
        mainEntity,
      };
    }
  • Registration of the 'generate_faq_schema' tool and call to the handler.
    server.tool(
      "generate_faq_schema",
      "Generate a FAQPage JSON-LD schema from a list of question-answer pairs.",
      {
        questions: z
          .array(
            z.object({
              question: z.string().describe("The question text"),
              answer: z.string().describe("The answer text"),
            })
          )
          .describe("Array of question-answer pairs"),
      },
      async (params) => {
        const schema = buildFaqSchema(params);
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(schema, null, 2),
            },
          ],
        };
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool generates JSON-LD schema but doesn't disclose behavioral traits such as whether it's read-only or mutating, error handling, output format details, or any rate limits. This leaves significant gaps for an agent to understand how to interact with it effectively.

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 directly states the tool's purpose without unnecessary words. It is front-loaded and every part earns its place, making it easy to parse quickly.

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 lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects, usage context, or output details, which are crucial for a tool that generates structured data. This leaves the agent with insufficient information to use the tool confidently.

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?

The description adds minimal semantic context beyond the schema, which has 100% coverage. It implies the input is 'a list of question-answer pairs,' aligning with the schema's 'questions' array, but doesn't explain formatting, constraints, or examples. With high schema coverage, the baseline of 3 is appropriate as the description provides little extra 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 verb ('Generate') and resource ('FAQPage JSON-LD schema'), specifying it creates structured data from question-answer pairs. However, it doesn't explicitly differentiate from sibling tools like 'generate_schema' or 'generate_article_schema', which likely produce different schema types.

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 like 'generate_schema' (general) or other specific schema generators. It mentions the input format but offers no context about prerequisites, typical use cases, or exclusions.

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