Skip to main content
Glama
ms-methos

jsonfabrica-mcp-server

Create a JsonFabrica template

jsonfabrica_create_template

Create a persistent JSON template using function-call placeholders, optionally generating data immediately with provided parameters.

Instructions

Calls POST /v1/templates. Creates a persisted, reusable template that can be generated from repeatedly with jsonfabrica_generate_from_template — use this instead of jsonfabrica_generate_adhoc when you want the body saved and shareable rather than a one-off, unsaved evaluation. body uses JsonFabrica's function-call placeholder syntax, e.g. "Hello {{getRandomFullName()}}" or "<getRandomNumber(1,100)>" — see the data-generation-functions reference for the full catalog. The optional generate field is a convenience that also runs a generation in the same call (response includes generation or generationError alongside template) so you avoid a separate jsonfabrica_generate_from_template round-trip; that generation is metered/billed and can advance durable sequences/variables just like a normal generate call. If generate is omitted, the response is just the created template with no generation side effects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesTemplate body containing at least one function-call placeholder. Required.
nameYesTemplate name. Required; not required to be unique per tenant.
tagsNoLabels for later filtering via jsonfabrica_list_templates' `tags` parameter (AND-match: a template must contain every requested tag). Optional; omitted or empty means no tags stored.
generateNoWhen present, immediately generates one document from the just-created template using these options; the response then includes `generation`/`generationError` alongside `template`. Optional — omit to only create the template record with no generation side effects.
descriptionNoFree-text human-readable description of the template's purpose. Optional; omitted means none stored.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyNoTemplate body containing function-call placeholders.
nameNoTemplate name.
tagsNoTags stored on the template.
statusNo"active" unless soft-deleted via jsonfabrica_delete_template.
astCacheNoServer-internal parsed-body cache; opaque to callers.
templateNoPresent when `generate` was passed; the created template record.
tenantIdNoOwning tenant id.
warningsNoNon-fatal validation warnings, if any.
createdAtNoISO-8601 creation timestamp.
updatedAtNoISO-8601 last-update timestamp.
validatedNoWhether the body passed static template validation.
generationNoPresent when `generate` was passed and the immediate generation succeeded.
templateIdNoServer-assigned template id.
descriptionNoFree-text description, if any was stored.
generationErrorNoPresent when `generate` was passed but the immediate generation failed at runtime (template was still created).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • changedInput schema / properties / body / description
      Previous value: -"Template body containing at least one function-call placeholder."New value: +"Template body containing at least one function-call placeholder. Required."
    • addedInput schema / properties / description / description
      Added value: +"Free-text human-readable description of the template's purpose. Optional; omitted means none stored."
    • addedInput schema / properties / generate / description
      Added value: +"When present, immediately generates one document from the just-created template using these options; the response then includes `generation`/`generationError` alongside `template`. Optional — omit to only create the template record with no generation side effects."
    • addedInput schema / properties / generate / properties / context / description
      Added value: +"Arbitrary key/value data made available to the template body alongside `params` (implementation- specific auxiliary context, e.g. for conditional logic). Optional; omitted keys are simply absent during generation."
    • changedInput schema / properties / generate / properties / params / description
      Previous value: -"Values for getParam() references in the body."New value: +"Key/value map supplying values for getParam(\"key\") placeholders referenced in the template body. Optional; omitted keys leave the corresponding getParam() calls unresolved/empty. Not related to sequence or variable namespacing."
    • changedInput schema / properties / generate / properties / seed / description
      Previous value: -"Deterministic seed for the generated document."New value: +"Deterministic PRNG seed for this generation — the same seed plus the same template body/params reproduces byte-identical random values. Optional; if omitted the server picks a random seed and returns it in the response so the result can be reproduced later."
    • changedInput schema / properties / name / description
      Previous value: -"Template name."New value: +"Template name. Required; not required to be unique per tenant."
    • addedInput schema / properties / tags / description
      Added value: +"Labels for later filtering via jsonfabrica_list_templates' `tags` parameter (AND-match: a template must contain every requested tag). Optional; omitted or empty means no tags stored."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "astCache": {
      +      "anyOf": [
      +        {
      +          "items": {},
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Server-internal parsed-body cache; opaque to callers."
      +    },
      +    "body": {
      +      "description": "Template body containing function-call placeholders.",
      +      "type": "string"
      +    },
      +    "createdAt": {
      +      "description": "ISO-8601 creation timestamp.",
      +      "type": "string"
      +    },
      +    "description": {
      +      "description": "Free-text description, if any was stored.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "generation": {
      +      "additionalProperties": false,
      +      "description": "Present when `generate` was passed and the immediate generation succeeded.",
      +      "properties": {
      +        "data": {
      +          "description": "The generated document; shape is entirely determined by the template body."
      +        },
      +        "meta": {
      +          "additionalProperties": false,
      +          "description": "Generation metadata.",
      +          "properties": {
      +            "documentSeed": {
      +              "description": "Per-document seed, present for some generation paths.",
      +              "type": "number"
      +            },
      +            "generatedAt": {
      +              "description": "ISO-8601 timestamp of generation.",
      +              "type": "string"
      +            },
      +            "seed": {
      +              "description": "PRNG seed actually used for this generation.",
      +              "type": "number"
      +            },
      +            "templateId": {
      +              "description": "Present when generated from a persisted template.",
      +              "type": "string"
      +            }
      +          },
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "data",
      +        "meta"
      +      ],
      +      "type": "object"
      +    },
      +    "generationError": {
      +      "additionalProperties": false,
      +      "description": "Present when `generate` was passed but the immediate generation failed at runtime (template was still created).",
      +      "properties": {
      +        "code": {
      +          "type": "string"
      +        },
      +        "message": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "code",
      +        "message"
      +      ],
      +      "type": "object"
      +    },
      +    "name": {
      +      "description": "Template name.",
      +      "type": "string"
      +    },
      +    "status": {
      +      "description": "\"active\" unless soft-deleted via jsonfabrica_delete_template.",
      +      "enum": [
      +        "active",
      +        "archived"
      +      ],
      +      "type": "string"
      +    },
      +    "tags": {
      +      "description": "Tags stored on the template.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "template": {
      +      "additionalProperties": false,
      +      "description": "Present when `generate` was passed; the created template record.",
      +      "properties": {
      +        "astCache": {
      +          "anyOf": [
      +            {
      +              "items": {},
      +              "type": "array"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "Server-internal parsed-body cache; opaque to callers."
      +        },
      +        "body": {
      +          "description": "Template body containing function-call placeholders.",
      +          "type": "string"
      +        },
      +        "createdAt": {
      +          "description": "ISO-8601 creation timestamp.",
      +          "type": "string"
      +        },
      +        "description": {
      +          "description": "Free-text description, if any was stored.",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "name": {
      +          "description": "Template name.",
      +          "type": "string"
      +        },
      +        "status": {
      +          "description": "\"active\" unless soft-deleted via jsonfabrica_delete_template.",
      +          "enum": [
      +            "active",
      +            "archived"
      +          ],
      +          "type": "string"
      +        },
      +        "tags": {
      +          "description": "Tags stored on the template.",
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "templateId": {
      +          "description": "Server-assigned template id.",
      +          "type": "string"
      +        },
      +        "tenantId": {
      +          "description": "Owning tenant id.",
      +          "type": "string"
      +        },
      +        "updatedAt": {
      +          "description": "ISO-8601 last-update timestamp.",
      +          "type": "string"
      +        },
      +        "validated": {
      +          "description": "Whether the body passed static template validation.",
      +          "type": "boolean"
      +        },
      +        "warnings": {
      +          "description": "Non-fatal validation warnings, if any.",
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "templateId",
      +        "tenantId",
      +        "name",
      +        "body",
      +        "status",
      +        "createdAt",
      +        "updatedAt"
      +      ],
      +      "type": "object"
      +    },
      +    "templateId": {
      +      "description": "Server-assigned template id.",
      +      "type": "string"
      +    },
      +    "tenantId": {
      +      "description": "Owning tenant id.",
      +      "type": "string"
      +    },
      +    "updatedAt": {
      +      "description": "ISO-8601 last-update timestamp.",
      +      "type": "string"
      +    },
      +    "validated": {
      +      "description": "Whether the body passed static template validation.",
      +      "type": "boolean"
      +    },
      +    "warnings": {
      +      "description": "Non-fatal validation warnings, if any.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observedv0.1.4

TDQS

A4.7/5.0
Behavior4/5

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

Beyond the minimal annotations, the description discloses persistence, optional generation side effects, metering/billing, durable sequence/variable advancement, and the absence of side effects when generate is omitted. It does not enumerate every possible side effect, but it provides sufficient transparency.

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

Conciseness4/5

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

The description is well organized and free of fluff, though the optional-generate section is long and contains several nested clauses. Overall, every sentence adds useful guidance.

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

Completeness5/5

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

Combined with full schema descriptions and the output schema indication, the description covers when to use the tool, what side effects to expect, and what response shape to anticipate when generate is present or omitted.

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

Parameters5/5

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

Schema descriptions cover all parameters, and the tool description adds meaningful behavioral detail: tags use AND-match, unresolved params remain empty, params are unrelated to sequence/variable namespacing, and context is implementation-specific auxiliary data.

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 explicitly says the tool 'Creates a persisted, reusable template' and contrasts it with jsonfabrica_generate_adhoc and jsonfabrica_generate_from_template, making the purpose and resource type clear.

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

Usage Guidelines5/5

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

It gives direct selection guidance: use this instead of jsonfabrica_generate_adhoc when the body should be saved and shareable, and explains the optional generate field as a convenience to avoid a separate round-trip.

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