Skip to main content
Glama

list_templates

List pre-built database schema templates for common app patterns, such as ecommerce, blog, SaaS, and social media, to generate realistic test data with proper relationships.

Instructions

List pre-built schema templates for common application patterns.

Available templates:

  • ecommerce: Customers, products, orders, order items, reviews (5 tables)

  • blog: Authors, posts, comments, tags, post_tags (5 tables)

  • saas: Organizations, members, subscriptions, invoices (4 tables)

  • social: Users, posts, likes, follows, messages (5 tables)

Each template includes realistic field types, proper foreign key relationships, weighted enum distributions, and auto-locale detection via country fields.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP handler function for the 'list_templates' tool. Calls listTemplates() from @engine and wraps result in ok().
    function handleListTemplates(): ToolResult {
      return ok(listTemplates());
    }
  • Core implementation: iterates TEMPLATE_REGISTRY and returns a lightweight array of TemplateSummary objects (id, name, description, tables, default_counts), omitting the full schema.
    export function listTemplates(): TemplateSummary[] {
      return Object.values(TEMPLATE_REGISTRY).map(
        ({ id, name, description, tables, default_counts }) => ({
          id,
          name,
          description,
          tables,
          default_counts,
        }),
      );
    }
  • Alternative MCP server registration for 'list_templates' that calls GET /api/v1/templates via an API call rather than using the engine directly.
    server.tool(
      "list_templates",
      `List pre-built schema templates for common application patterns.
    
    Available templates:
    - ecommerce: Customers, products, orders, order items, reviews (5 tables)
    - blog: Authors, posts, comments, tags, post_tags (5 tables)
    - saas: Organizations, members, subscriptions, invoices (4 tables)
    - social: Users, posts, likes, follows, messages (5 tables)
    
    Each template includes realistic field types, proper foreign key relationships,
    weighted enum distributions, and auto-locale detection via country fields.`,
      {},
      async () => {
        const res = await apiCall("GET", "/api/v1/templates");
    
        if (!res.ok) {
          return {
            content: [
              {
                type: "text" as const,
                text: `API error (${res.status}): ${JSON.stringify(res.data, null, 2)}`,
              },
            ],
            isError: true,
          };
        }
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(res.data, null, 2),
            },
          ],
        };
      }
    );
  • The TemplateSummary interface defining the shape of objects returned by listTemplates() — id, name, description, tables, default_counts.
    export interface TemplateSummary {
      id: string;
      name: string;
      description: string;
      tables: string[];
      default_counts: Record<string, number>;
  • Tool definition registration in the MCP tool definitions array — declares name 'list_templates', description, and empty inputSchema.
      {
        name: "list_templates",
        description:
          "List pre-built schema templates for common database patterns: e-commerce, blog, SaaS, and social network.",
        inputSchema: {
          type: "object",
          properties: {},
        },
      },
      {
        name: "generate_from_template",
        description:
          "Generate test data using a pre-built template. Available templates: ecommerce, blog, saas, social. Use 'scale' to multiply record counts.",
        inputSchema: {
          type: "object",
          properties: {
            template: {
              type: "string",
              description:
                "Template ID: ecommerce, blog, saas, or social",
            },
            locale: {
              type: "string",
              description: "Locale for generated data. Default: en",
            },
            scale: {
              type: "number",
              description:
                "Multiplier for all table record counts. E.g. scale=10 generates 10x the default rows.",
            },
            format: {
              type: "string",
              enum: ["json", "csv", "sql"],
              description: "Output format. Default: json",
            },
            seed: {
              type: "number",
              description: "PRNG seed for reproducible output.",
            },
          },
          required: ["template"],
        },
      },
    ];
Behavior4/5

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

With no annotations, the description carries full burden. It discloses that templates include realistic field types, foreign keys, weighted enums, and locale detection, giving useful behavioral context beyond just listing names.

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?

Description is concise: one opening sentence, then a bullet list of templates. No extraneous words, front-loaded with purpose.

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

Completeness4/5

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

Given no output schema, the description compensates by detailing what each template contains (table names, counts, features). It is sufficient for an agent to understand what will be returned, though the exact response format is not specified.

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

Parameters4/5

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

Input schema has zero parameters, so schema coverage is 100%. Baseline 4 applies; description does not need to add parameter details.

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

Purpose5/5

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

The description clearly states it lists pre-built schema templates for common application patterns. It explicitly names four templates with their table counts, which distinguishes it from sibling tools like detect_schema or generate_from_template.

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

Usage Guidelines4/5

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

The description implies usage: call this to see available templates before using generate_from_template. It provides clear context but does not explicitly state when not to use or contrast with siblings, though the purpose is inherently clear.

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/dinosaur24/mockhero'

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