Skip to main content
Glama

campaignstack_preview_craft_prompt

Read-onlyIdempotent

Render the exact prompt a craft node would send for one lead, without sending it. Call this when the user asks to see what a draft would look like, or to debug why a node's wording keeps going wrong. Runs the real craft path and stops immediately before the model call, so what comes back is the same bytes the model would read. index lists the named blocks in the system prompt with their character offsets and sizes (COMPANY CONTEXT, WHAT WE WANT, the playbook sections, RED LINES, the voice), which is how you find out WHICH piece of configuration produces a phrase you do not want. Writes no audit row, records no AI usage, assigns no voice experiment arm, fetches no web context, and costs nothing. Pair it with campaignstack_get_craft_config_tree, which shows where each block comes from.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
leadIdYesThe lead to render the prompt for. Different leads produce different prompts.
nodeIdYesA craft node: ai:craft_note, ai:craft_message, ai:craft_comment, ai:reply_conversation, ai:craft_email, or a send node in its AI mode.
includeNoWhat to return. Default: index and user. The system prompt runs to thousands of characters, so ask for it when you are going to read it.
leadSourceNoOptional. Leave it out: the server reads it from the leadId and refuses a value that disagrees.
workflowIdYesThe workflow the node belongs to.
workspaceIdNoWorkspace ID. Omit it when this connection reaches one workspace: a workspace key (cs_) is bound to its own, and a user key (csu_) or connected app whose person belongs to exactly one workspace defaults to that one. Required only when the person belongs to several; the error then lists them, and campaignstack_whoami reports them too.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
charsNo
indexNo
callerNo
nodeTypeNo
userPromptNo
systemPromptNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / leadSource / description
      Previous value: -"Which lead table the id is in. Default: global."New value: +"Optional. Leave it out: the server reads it from the leadId and refuses a value that disagrees."
  2. Changed1 schema field changed
    • changedInput schema / properties / workspaceId / description
      Previous value: -"Workspace ID. REQUIRED for a user key (csu_), which spans every workspace you belong to; omitted for a workspace key (cs_), which is bound to one and ignores this argument. campaignstack_whoami reports which kind of key you are holding and, for a user key, the workspaces it can reach."New value: +"Workspace ID. Omit it when this connection reaches one workspace: a workspace key (cs_) is bound to its own, and a user key (csu_) or connected app whose person belongs to exactly one workspace defaults to that one. Required only when the person belongs to several; the error then lists them, and campaignstack_whoami reports them too."
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "caller": {
      +      "anyOf": [
      +        {
      +          "anyOf": [
      +            {
      +              "not": {}
      +            },
      +            {
      +              "type": "string"
      +            }
      +          ]
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "chars": {
      +      "anyOf": [
      +        {
      +          "anyOf": [
      +            {
      +              "not": {}
      +            },
      +            {
      +              "additionalProperties": true,
      +              "properties": {
      +                "systemPrompt": {
      +                  "anyOf": [
      +                    {
      +                      "anyOf": [
      +                        {
      +                          "not": {}
      +                        },
      +                        {
      +                          "type": "number"
      +                        }
      +                      ]
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ]
      +                },
      +                "userPrompt": {
      +                  "anyOf": [
      +                    {
      +                      "anyOf": [
      +                        {
      +                          "not": {}
      +                        },
      +                        {
      +                          "type": "number"
      +                        }
      +                      ]
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ]
      +                }
      +              },
      +              "type": "object"
      +            }
      +          ]
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "index": {
      +      "anyOf": [
      +        {
      +          "anyOf": [
      +            {
      +              "not": {}
      +            },
      +            {
      +              "items": {},
      +              "type": "array"
      +            }
      +          ]
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "nodeType": {
      +      "anyOf": [
      +        {
      +          "anyOf": [
      +            {
      +              "not": {}
      +            },
      +            {
      +              "type": "string"
      +            }
      +          ]
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "systemPrompt": {
      +      "anyOf": [
      +        {
      +          "anyOf": [
      +            {
      +              "not": {}
      +            },
      +            {
      +              "type": "string"
      +            }
      +          ]
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "userPrompt": {
      +      "anyOf": [
      +        {
      +          "anyOf": [
      +            {
      +              "not": {}
      +            },
      +            {
      +              "type": "string"
      +            }
      +          ]
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  4. Added

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations by enumerating concrete side effects that do NOT occur: no audit row, no AI usage record, no voice experiment arm, no web fetch, no cost. This is exactly the kind of behavior an agent cannot infer from the annotations.

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?

Front-loaded with purpose, then trigger conditions, then mechanics, side effects, and pairing. It is on the long side, but each sentence carries distinct information; little is redundant.

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?

With an output schema present, return values need no prose, and the description still covers scope, side effects, the index structure, and the sibling relationship. Nothing needed to call it correctly is missing.

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?

Schema coverage is 100%, so the baseline is 3. The description still adds value by explaining what 'index' actually returns (named blocks with character offsets and sizes, e.g. COMPANY CONTEXT, RED LINES) and by noting leads produce different prompts, which clarifies the leadId dimension.

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 ('Render the exact prompt a craft node would send for one lead, without sending it') and immediately clarifies the non-sending scope, which separates it from sibling send/craft tools like campaignstack_craft_message and campaignstack_send_message.

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?

Gives explicit triggers ('when the user asks to see what a draft would look like, or to debug why a node's wording keeps going wrong') and names a complementary sibling, campaignstack_get_craft_config_tree, with the distinction between them (bytes vs. provenance).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources