Skip to main content
Glama
ms-methos

jsonfabrica-mcp-server

Generate a document from a JsonFabrica template

jsonfabrica_generate_from_template

Generate a document from a persisted template using a template ID, optional parameters, and a seed for reproducible output. Isolate sequence and variable side effects with namespaces for safe testing.

Instructions

Calls POST /v1/templates/{templateId}/generate. Generates a document from a persisted, saved template referenced by templateId — use this (not jsonfabrica_generate_adhoc) when the template is meant to be reused or shared across calls/tenants; use jsonfabrica_generate_adhoc instead when you are still iterating on raw template syntax and don't want to persist anything yet. This call is metered/billed like any generation and, unless namespaced, can advance real durable sequences and mutate durable variables referenced by the template body. Set sequenceNamespace/variableNamespace to isolate those side effects between environments (e.g. test vs. production).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedNoDeterministic PRNG seed for this generation — the same seed reproduces byte-identical random values. Optional; if omitted the server picks a random seed and returns it in the response.
paramsNoKey/value map supplying values for getParam("key") placeholders in the template body. Optional; omitted keys leave the corresponding getParam() calls unresolved/empty.
contextNoArbitrary auxiliary key/value data made available to the template body alongside `params`. Optional; omitted keys are simply absent during generation.
templateIdYesID of the persisted template to generate a document from. Required.
sequenceNamespaceNoIsolates createSeq()/getSeq() durable-sequence side effects under this namespace so repeated test/debug runs don't advance real tenant sequences. Optional; omitted means the default (unnamespaced) sequence scope is used.
variableNamespaceNoIsolates durable-variable side effects under this namespace, analogous to `sequenceNamespace`. Optional; omitted means the default (unnamespaced) variable scope is used.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesThe generated document; shape is entirely determined by the template body.
metaYesGeneration metadata.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / context / description
      Added value: +"Arbitrary auxiliary key/value data made available to the template body alongside `params`. Optional; omitted keys are simply absent during generation."
    • addedInput schema / properties / params / description
      Added value: +"Key/value map supplying values for getParam(\"key\") placeholders in the template body. Optional; omitted keys leave the corresponding getParam() calls unresolved/empty."
    • addedInput schema / properties / seed / description
      Added value: +"Deterministic PRNG seed for this generation — the same seed reproduces byte-identical random values. Optional; if omitted the server picks a random seed and returns it in the response."
    • addedInput schema / properties / sequenceNamespace / description
      Added value: +"Isolates createSeq()/getSeq() durable-sequence side effects under this namespace so repeated test/debug runs don't advance real tenant sequences. Optional; omitted means the default (unnamespaced) sequence scope is used."
    • addedInput schema / properties / templateId / description
      Added value: +"ID of the persisted template to generate a document from. Required."
    • addedInput schema / properties / variableNamespace / description
      Added value: +"Isolates durable-variable side effects under this namespace, analogous to `sequenceNamespace`. Optional; omitted means the default (unnamespaced) variable scope is used."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "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"
      +}
  2. First observedv0.1.4

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the annotations, it discloses side effects on sequences/variables, the ability to isolate them via namespaces, and the metered/billed nature of the call.

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?

Focused and mostly efficient, though 'persisted, saved' is mildly redundant and the side-effect explanation could be tightened.

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?

Covers usage, side effects, and namespace semantics; the output schema handles return details, so no critical missing context.

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 schema already covers 100% of parameters with detailed descriptions; the prose adds context but no significant parameter-level meaning beyond that.

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?

States a specific action (generate a document from a persisted template) and explicitly contrasts with jsonfabrica_generate_adhoc, making the tool's purpose unmistakable.

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?

Explicitly says when to use this tool versus the adhoc alternative, and warns about metering/billing plus durable side effects with namespace guidance.

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