Skip to main content
Glama

template_create

Create reusable SignWell templates by uploading documents and defining signer placeholders for repeatable e-signature workflows.

Instructions

Create a SignWell template for reusable signature documents.

RECOMMENDED WORKFLOW:

  1. file_store (provide file_path, file_url, or resource_uri) → returns file_token

  2. file_validate_text_tags (pass file_token) → validates tags are extractable

  3. template_create (pass file_token in files array) → creates the template

REQUIRED PARAMETERS (both are mandatory):

  • files: Array with at least one file object containing:

    • "name": Filename (e.g., "template.docx")

    • One content source (in order of preference):

      • "content_text": Plain text/Markdown to auto-convert to DOCX (RECOMMENDED for generated content)

      • "file_token": Token from file_store (recommended for uploaded files)

      • "file_base64": Base64-encoded file content

      • "file_url": Public URL to the file

      • "resource_uri": MCP resource URI

  • placeholders: Array with at least one placeholder object containing "id" and "name"

STEP-BY-STEP EXAMPLE (using file_token):

  1. Call file_store with {"file_path": "/path/to/doc.pdf"} → get file_token

  2. Call file_validate_text_tags with {"file_token": "..."} → confirm tags are valid

  3. Call this tool with: { "name": "My Template", "files": [{"name": "doc.pdf", "file_token": ""}], "placeholders": [{"id": "1", "name": "Signer"}], "text_tags": true }

ALTERNATIVE (inline base64): { "name": "My Template", "files": [{"name": "doc.pdf", "file_base64": "JVBERi0xLjQK..."}], "placeholders": [{"id": "1", "name": "Signer"}], "text_tags": true }

TEXT TAGS (when text_tags: true): Your PDF must contain these literal text strings as SELECTABLE TEXT (not images):

  • {{signature:1:y}} - Signature field for placeholder id "1"

  • {{date:1:y}} - Date field for placeholder id "1"

  • {{autofill_date_signed:1:y}} or {{date:1:y::::::y}} - Automatically populated, locked signing date (plain date fields are editable)

  • {{text:1:y:Label}} - Text field with label

  • {{initial:1:y}} - Initials field

The number in the tag (1, 2, etc.) MUST match a placeholder "id" in your request.

CRITICAL: Text tags must be SELECTABLE/SEARCHABLE text in the PDF, not rendered as images or graphics. When generating PDFs programmatically, use text drawing methods (e.g., drawString) with standard fonts. To verify: open the PDF and try to select/copy the tag text with your mouse. If you can't select it, SignWell can't parse it.

MULTI-SIGNER EXAMPLE: { "name": "Contract", "files": [{"name": "contract.pdf", "file_base64": "JVBERi0xLjQK...actual base64 here..."}], "placeholders": [ {"id": "1", "name": "Client"}, {"id": "2", "name": "Vendor"} ], "text_tags": true }

For this example, the PDF should contain: {{signature:1:y}} for Client and {{signature:2:y}} for Vendor.

COMMON ERRORS:

  • Empty arguments {} = You forgot to include files and placeholders arrays

  • "fields": [] in response = PDF doesn't contain valid text tags, or text_tags wasn't set to true

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": {
      "files": "<files>",
      "placeholders": "<placeholders>"
    },
    "name": "template_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoTemplate name (e.g., 'Permission Slip').
draftNoIf true, template stays editable. If false, marked Available. Default: false per API.
filesYesREQUIRED. Files to upload. Each needs 'name' plus one of: 'file_url', 'file_base64', or 'resource_uri'.
fieldsNo2D array of fields: one array per file. Required if draft is false.
labelsNoLabels for organizing templates.
messageNoEmail message for signature requests (max 4000 chars).
subjectNoEmail subject for signature requests.
languageNoLanguage for template (ISO 639-1).
metadataNoKey-value metadata (max 50 pairs, key max 40 chars, value max 500 chars).
remindersNoSend signing reminders on day 3, 6, and 10.
text_tagsNoSet TRUE if PDF contains text tags like {{signature:1:y}}. Placeholder 'id' values must match the signer numbers in tags (e.g., id='1' for {{signature:1:y}}).
expires_inNoDays before signature request expires (max 365).
placeholdersYesREQUIRED. Signing roles. Each needs 'id' and 'name'. For text tags, the 'id' must match tag IDs (e.g., id='signer1' matches [sig|req|signer1]).
redirect_urlNoURL to redirect after successful signing.
allow_declineNoAllow recipients to decline signing.
allow_reassignNoAllow recipients to reassign to someone else.
checkbox_groupsNoGrouped checkbox fields with validation.
api_application_idNoAPI Application ID for settings isolation.
apply_signing_orderNoRecipients sign in order.
attachment_requestsNoAttachments recipients must upload.
copied_placeholdersNoRecipients who receive the final document after completion.
decline_redirect_urlNoURL to redirect if document is declined.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.3.9
    • removedInput schema / properties / fields / items / items / properties / value / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "boolean"
      -  }
      -]
    • addedInput schema / properties / fields / items / items / properties / value / type
      Added value: +[
      +  "string",
      +  "number",
      +  "boolean"
      +]
    • addedInput schema / required
      Added value: +[
      +  "files",
      +  "placeholders"
      +]
  2. First observedv0.3.3

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false), the description discloses critical behavioral requirements: text tags must be selectable text, tags must match placeholder IDs, and common failure modes (empty fields in response indicate missing tags). This goes well beyond what the annotations convey.

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-structured with headers and front-loaded purpose, but it is lengthy due to multiple full JSON examples. While most content is useful, some repetition (step-by-step and alternative examples) could be trimmed without losing clarity.

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?

For a 22-parameter tool with nested objects and no output schema, the description covers the essential workflows, tag syntax, failure modes, and parameter interactions. The schema itself documents all parameters, so the description's focus on tricky aspects makes it complete.

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?

With 100% schema coverage, the baseline is 3, but the description adds meaningful semantics: content source preference order, the mapping between placeholder 'id' and text tag signer numbers, and the effect of text_tags=true. It still repeats some schema details, so it falls short of 5.

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 opens with a specific verb and resource: 'Create a SignWell template for reusable signature documents.' This clearly distinguishes it from sibling tools like document_create and template_create_document, and the workflow further reinforces its role.

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 provides an explicit RECOMMENDED WORKFLOW naming prerequisite tools (file_store, file_validate_text_tags) and step-by-step examples, including an alternative inline base64 path. This makes the when-to-use context and ordering of operations unmistakable.

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