Skip to main content
Glama

Create a document from a template

create_document_from_template

Create a draft from a template by filling in its {{ variables }}. Set send=true to send it straight away; otherwise review it and call send_document. Missing variables return a missing_variables error listing them. Returns preview_url, a 7-day link to show your human the document and compare styles.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "template_id": "<template_id>"
    },
    "name": "create_document_from_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
sendNoSend immediately after creating the draft.
styleNoVisual style for the email and signing page. Overrides the md2sign:style directive. Default classic.
titleNoDocument title shown to signers. Defaults to the md2sign:title directive or the first # heading.
api_keyNoAn md2sign API key. When given, this call uses that key's account even if the connection is signed in as someone else, so pass it on every call when your human has more than one md2sign account (for example two businesses). Also use it if your MCP client cannot send an "Authorization: Bearer <api_key>" header.
messageNoShort personal note from the sender.
versionNoTemplate version to use. Defaults to the latest.
metadataNoYour own key/value details for this document, e.g. {"customer_number": "C-1001", "job_number": "J-77", "quote_number": "Q-310"}. Flat object, up to 20 keys (starting with a letter or _, then letters, numbers, _ or -), text or number values up to 500 characters, stored as text. Returned in responses and webhooks; find documents by it with list_documents metadata.
variablesNoValues for every {{ variable }} in the template, e.g. {"client_name": "Jane Citizen", "client_email": "jane@example.com"}.
sender_roleNoOptional role shown on the sender's signature, e.g. "Client" or "Director". Used with sender_signs=true.
template_idYesThe template ID.
sender_signsNotrue adds a signature field for the sender (the account holder, using their name and email); false removes it. Only for two-sided agreements (services/contractor agreements, mutual NDAs, leases, partnerships). Never for quotes, proposals, consents, acknowledgements, waivers or one-way NDAs, where only the recipient signs. Check validation.signing_advice and ask the human if unsure.
verify_signersNoTeam plans: true makes every signer confirm a one-time code emailed to them before their signature is recorded (adds <!-- md2sign:verify=email -->); false turns it off for this document even when the account verifies signers by default (verify=none). Omit to use the account default.
external_referenceNoYour own ID for this document (e.g. a CRM deal or invoice number). Returned in responses and webhooks.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / metadata
      Added value: +{
      +  "description": "Your own key/value details for this document, e.g. {\"customer_number\": \"C-1001\", \"job_number\": \"J-77\", \"quote_number\": \"Q-310\"}. Flat object, up to 20 keys (starting with a letter or _, then letters, numbers, _ or -), text or number values up to 500 characters, stored as text. Returned in responses and webhooks; find documents by it with list_documents metadata.",
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / verify_signers / description
      Previous value: -"Pro: true makes every signer confirm a one-time code emailed to them before their signature is recorded (adds <!-- md2sign:verify=email -->); false turns it off for this document even when the account verifies signers by default (verify=none). Omit to use the account default."New value: +"Team plans: true makes every signer confirm a one-time code emailed to them before their signature is recorded (adds <!-- md2sign:verify=email -->); false turns it off for this document even when the account verifies signers by default (verify=none). Omit to use the account default."
  3. Changed1 schema field changed
    • changedInput schema / properties / api_key / description
      Previous value: -"Your md2sign API key. Only needed if your MCP client cannot send an \"Authorization: Bearer <api_key>\" header."New value: +"An md2sign API key. When given, this call uses that key's account even if the connection is signed in as someone else, so pass it on every call when your human has more than one md2sign account (for example two businesses). Also use it if your MCP client cannot send an \"Authorization: Bearer <api_key>\" header."
  4. Changed1 schema field changed
    • addedInput schema / properties / verify_signers
      Added value: +{
      +  "description": "Pro: true makes every signer confirm a one-time code emailed to them before their signature is recorded (adds <!-- md2sign:verify=email -->); false turns it off for this document even when the account verifies signers by default (verify=none). Omit to use the account default.",
      +  "type": "boolean"
      +}
  5. Changed2 schema fields changed
    • addedInput schema / properties / sender_role
      Added value: +{
      +  "description": "Optional role shown on the sender's signature, e.g. \"Client\" or \"Director\". Used with sender_signs=true.",
      +  "type": "string"
      +}
    • addedInput schema / properties / sender_signs
      Added value: +{
      +  "description": "true adds a signature field for the sender (the account holder, using their name and email); false removes it. Only for two-sided agreements (services/contractor agreements, mutual NDAs, leases, partnerships). Never for quotes, proposals, consents, acknowledgements, waivers or one-way NDAs, where only the recipient signs. Check validation.signing_advice and ask the human if unsure.",
      +  "type": "boolean"
      +}
  6. Changed3 schema fields changed
    • addedInput schema / properties / external_reference / description
      Added value: +"Your own ID for this document (e.g. a CRM deal or invoice number). Returned in responses and webhooks."
    • addedInput schema / properties / style / description
      Added value: +"Visual style for the email and signing page. Overrides the md2sign:style directive. Default classic."
    • addedInput schema / properties / title / description
      Added value: +"Document title shown to signers. Defaults to the md2sign:title directive or the first # heading."
  7. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare the mutation profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=true), so the description's added value is the missing_variables error contract and the preview_url return with its 7-day lifetime. That is genuinely useful behavior beyond the structured fields, though it does not cover draft lifecycle or editability.

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?

Three short sentences, each carrying distinct information: what it does, how to send or defer, and what comes back. The send/preview guidance is front-loaded with no filler.

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?

For a 13-parameter mutation tool with no output schema, the description covers the key behavioral facts an agent needs: variable filling, direct-send option, error on missing variables, and the preview URL for human review. It leaves more exotic parameters (metadata, verify_signers) entirely to the schema, which is reasonable.

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% and the schema itself is unusually detailed, so the description only adds meaning for variables and send. The remaining 11 parameters get no elaboration in the description, which is acceptable given the schema does the work.

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?

"Create a draft from a template by filling in its {{ variables }}" states a specific verb, resource, and mechanism, and implicitly separates this tool from create_draft (markdown) and send_document (final send). An agent can tell immediately what this tool produces.

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 gives a clear branch: send=true to send straight away, otherwise review and call send_document. It also names the failure mode (missing_variables) that tells the agent to fill in more data. It stops short of stating when to pick this over create_draft, so it is not a full 5.

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.