Skip to main content
Glama

build-system-prompt

Generates a custom MDMA prompt from structured input (domain, components, fields, steps). Returns only the custom prompt part — use buildSystemPrompt({ customPrompt }) in code to combine it with the base MDMA spec.

Instructions

Generates a custom MDMA prompt from structured input (domain, components, fields, steps). Returns only the custom prompt part — use buildSystemPrompt({ customPrompt }) in code to combine it with the base MDMA spec. When dataSources (an external data-source catalog) is passed, returns the full system prompt instead: base MDMA spec, the data-source catalog with the rule to reference it via { source, params }, and the custom part.

Input Schema

NameRequiredDescriptionDefault
stepsNoMulti-step flow definitions — each step becomes a separate conversation turn
domainNoDomain context (e.g. "HR onboarding", "expense approval")
fieldsNoForm field definitions
componentsNoComponent types to use (e.g. ["form", "approval-gate", "webhook"])
dataSourcesNoExternal data-source catalog. Each entry: name, optional description, kind ("rows" for table.data, "series" for chart.data, "options" for form select options), optional columns [{ key, type: string|number|boolean|date, description?, sensitive? }], optional params [{ name, type: string|number|boolean, required?, allowed? }]. Names must be unique, but the same data may appear as a rows and a series entry under different names. The model is told to reference sources via { source, params } instead of generating rows.
businessRulesNoBusiness rules or constraints

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.1.2
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / dataSources
      Added value: +{
      +  "description": "External data-source catalog. Each entry: name, optional description, kind (\"rows\" for table.data, \"series\" for chart.data, \"options\" for form select options), optional columns [{ key, type: string|number|boolean|date, description?, sensitive? }], optional params [{ name, type: string|number|boolean, required?, allowed? }]. Names must be unique, but the same data may appear as a rows and a series entry under different names. The model is told to reference sources via { source, params } instead of generating rows.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "columns": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "description": {
      +              "type": "string"
      +            },
      +            "key": {
      +              "minLength": 1,
      +              "type": "string"
      +            },
      +            "sensitive": {
      +              "default": false,
      +              "type": "boolean"
      +            },
      +            "type": {
      +              "enum": [
      +                "string",
      +                "number",
      +                "boolean",
      +                "date"
      +              ],
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "key",
      +            "type"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "description": {
      +        "type": "string"
      +      },
      +      "kind": {
      +        "enum": [
      +          "options",
      +          "rows",
      +          "series"
      +        ],
      +        "type": "string"
      +      },
      +      "name": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "params": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "allowed": {
      +              "items": {
      +                "type": [
      +                  "string",
      +                  "number",
      +                  "boolean"
      +                ]
      +              },
      +              "type": "array"
      +            },
      +            "name": {
      +              "minLength": 1,
      +              "type": "string"
      +            },
      +            "required": {
      +              "default": false,
      +              "type": "boolean"
      +            },
      +            "type": {
      +              "enum": [
      +                "string",
      +                "number",
      +                "boolean"
      +              ],
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "name",
      +            "type"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "kind"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / fields / items / additionalProperties
      Added value: +false
    • addedInput schema / properties / steps / items / additionalProperties
      Added value: +false
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does most of it: it discloses the two possible return shapes (custom part only vs. full system prompt including base spec and catalog) and the downstream combinination step. It omits failure modes, input validation behavior, or any side effects, which would round out a no-annotation mutation-free generator.

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?

Purpose and inputs are front-loaded in the first clause, followed by two compact sentences covering the two return modes and the in-code combination step. Every sentence carries distinct information with no restatement of the tool name or filler.

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?

There is no output schema, so the description must explain return values — and it does so precisely for both branches (custom-only vs. full prompt with base spec and catalog). With all parameters documented at 100% coverage and the integration contract spelled out, an agent has everything needed to invoke and consume the result.

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%, so the schema already documents all six parameters in depth, including the dataSources catalog semantics and the { source, params } reference rule. The description adds framing ('external data-source catalog') and the behavioral consequence of passing it, but no syntax or format detail beyond the schema, so the baseline 3 applies.

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 verb and resource ('Generates a custom MDMA prompt') and enumerates the structured inputs (domain, components, fields, steps) plus the conditional dataSources input. The generative framing clearly separates it from sibling read-style tools such as get-prompt and list-prompt-variants without the agent needing to open a schema.

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?

Gives concrete integration guidance ('use buildSystemPrompt({ customPrompt }) in code to combine it with the base MDMA spec') and a conditional usage rule (pass dataSources to get the full prompt instead). It never explicitly states when to prefer this over get-prompt or validate-prompt, so it stops short of naming alternatives or exclusions.

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