Skip to main content
Glama
Synctest-hub

BoldSign MCP Server

send_document_from_template

Send documents for signing using predefined templates. Specify recipients, fill form fields, and configure sending options to create and distribute signature-ready documents.

Instructions

Initiates the process of sending a document based on a pre-defined template. This tool allows you to specify recipients, form field values, and various sending options to create and send a document for signing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
templateIdYesRequired. The unique identifier (ID) of the template to be used for sending the document. This can be obtained from the list templates tool.
bodyYesOptional. The main content and settings for sending the document.

Implementation Reference

  • The core handler function that executes the tool logic: initializes TemplateApi, converts roles, calls sendUsingTemplate API, and handles response/error.
    async function sendDocumentFromTemplateDynamicHandler(
      payload: SendDocumentFromTemplateSchemaType,
    ): Promise<McpResponse> {
      try {
        const templateApi = new TemplateApi();
        templateApi.basePath = configuration.getBasePath();
        templateApi.setApiKey(configuration.getApiKey());
        const roles = getRolesFromRequestPayload(payload);
        const documentCreated: DocumentCreated = await templateApi.sendUsingTemplate(payload.templateId, {
          fileUrls: payload.body.fileUrls,
          title: payload.body.title ?? undefined,
          message: payload.body.message ?? undefined,
          roles: roles,
          brandId: payload.body.brandId ?? undefined,
          disableEmails: payload.body.disableEmails ?? undefined,
          disableSMS: payload.body.disableSMS ?? undefined,
          hideDocumentId: payload.body.hideDocumentId ?? undefined,
          reminderSettings: payload.body.reminderSettings ?? undefined,
          cc: payload.body.cc ?? undefined,
          expiryDays: payload.body.expiryDays ?? undefined,
          enablePrintAndSign: payload.body.enablePrintAndSign ?? undefined,
          enableReassign: payload.body.enableReassign ?? undefined,
          enableSigningOrder: payload.body.enableSigningOrder ?? undefined,
          disableExpiryAlert: payload.body.disableExpiryAlert ?? undefined,
          scheduledSendTime: payload.body.scheduledSendTime ?? undefined,
          allowScheduledSend: payload.body.allowScheduledSend ?? undefined,
        } as SendForSignFromTemplateForm);
        return handleMcpResponse({
          data: documentCreated,
        });
      } catch (error: any) {
        return handleMcpError(error);
      }
    }
  • Zod schema for input validation, defining templateId and body with roles, signers, settings, reminders, expiry, etc.
    const SendDocumentFromTemplateSchema = z.object({
      templateId: commonSchema.InputIdSchema.describe(
        'Required. The unique identifier (ID) of the template to be used for sending the document. This can be obtained from the list templates tool.',
      ),
      body: z
        .object({
          title: commonSchema.OptionalStringSchema.describe(
            'This is the title of the document that will be displayed in the BoldSign user interface as well as in the signature request email.',
          ),
          message: commonSchema.OptionalStringSchema.describe(
            'A message for all the recipients. You can include the instructions that the signer should know before signing the document.',
          ),
          fileUrls: z
            .array(commonSchema.FileUrlSchema)
            .max(25)
            .optional()
            .nullable()
            .describe('Optional. An array of URLs pointing to additional files to be attached to the document.'),
          roles: RolesSchema,
          cc: z
            .array(
              z
                .object({
                  emailAddress: z.string().email().describe('Email address of the CC recipient.'),
                })
                .describe('Email address of the CC recipients.'),
            )
            .optional()
            .nullable()
            .describe(
              'Optional. An array of email addresses to be added as carbon copy (CC) recipients to the document. CC recipients will receive a copy of the completed document.',
            ),
          brandId: commonSchema.InputIdSchema.optional()
            .nullable()
            .describe(
              'The unique identifier (ID) of the brand to be associated with this document. If provided, the document will be branded accordingly.',
            ),
          disableEmails: commonSchema.OptionalBooleanSchema.describe(
            'Disables the sending of document related emails to all the recipients. The default value is false.',
          ),
          disableSMS: commonSchema.OptionalBooleanSchema.describe(
            'Disables the sending of document related SMS to all the recipients. The default value is false.',
          ),
          hideDocumentId: commonSchema.OptionalBooleanSchema.describe(
            'Decides whether the document ID should be hidden or not.',
          ),
          reminderSettings: z
            .object({
              enableAutoReminder: commonSchema.OptionalBooleanSchema.describe(
                'A flag indicating whether automatic reminders should be enabled for this document.',
              ),
              reminderDays: commonSchema.OptionalIntegerSchema.describe(
                'The number of days after which a reminder should be sent to the signers.',
              ),
              reminderCount: commonSchema.OptionalIntegerSchema.describe(
                'The maximum number of reminders to be sent to the signers.',
              ),
            })
            .optional()
            .nullable()
            .describe('Optional. Settings for automated reminders to be sent to the signers.'),
          expiryDays: commonSchema.OptionalIntegerSchema.default(60).describe(
            'The number of days after which the document expires. The default value is 60 days.',
          ),
          enablePrintAndSign: commonSchema.OptionalBooleanSchema.describe(
            'Allows the signer to print the document, sign, and upload it. The default value is false.',
          ),
          enableReassign: commonSchema.OptionalBooleanSchema.describe(
            'Allows the signer to reassign the signature request to another person. The default value is true.',
          ),
          enableSigningOrder: commonSchema.OptionalBooleanSchema.describe(
            'Enables or disables the signing order. If this option is enabled, then the signers can only sign the document in the specified order and cannot sign in parallel. The default value is false.',
          ),
          disableExpiryAlert: commonSchema.OptionalBooleanSchema.describe(
            'Disables the alert, which was shown one day before the expiry of the document.',
          ),
          scheduledSendTime: commonSchema.OptionalIntegerSchema.describe(
            "This property allows you to specify the date and time in Unix Timestamp format to schedule a document for sending at a future time. The scheduled time must be at least 30 minutes from the current time and must not exceed the document's expiry date.",
          ),
          allowScheduledSend: commonSchema.OptionalIntegerSchema.describe(
            'Indicates whether scheduled sending is allowed for this document (e.g., 1 for allowed, 0 for not allowed).',
          ),
        })
        .describe('Optional. The main content and settings for sending the document.'),
    });
  • Registration of the tool definition in the templates API tools array for MCP toolset.
    export const templatesApiToolsDefinitions: BoldSignTool[] = [
      sendDocumentFromTemplateDynamicToolDefinition,
      listTemplatesToolDefinition,
      getTemplatePropertiesToolDefinition,
    ];
  • Helper to transform input roles array into BoldSign Role objects used in the API call.
    function getRolesFromRequestPayload(payload: SendDocumentFromTemplateSchemaType): Array<Role> {
      const roles = new Array<Role>();
      payload?.body.roles?.forEach((requestRole) => {
        const role = new Role();
        role.roleIndex = requestRole.roleIndex ?? undefined;
        role.signerName = requestRole.signerDetails?.signerName ?? undefined;
        role.signerOrder = requestRole.signerDetails?.signerOrder ?? undefined;
        role.signerEmail = requestRole.signerDetails?.signerEmail ?? undefined;
        role.privateMessage = requestRole.privateMessage ?? undefined;
        role.authenticationCode = requestRole.authenticationCode ?? undefined;
        role.enableEmailOTP = requestRole.enableEmailOTP ?? undefined;
        role.authenticationType = requestRole.authenticationType
          ? (requestRole.authenticationType as unknown as Role.AuthenticationTypeEnum)
          : undefined;
        role.phoneNumber = requestRole.phoneNumber ?? undefined;
        role.deliveryMode = requestRole.deliveryMode
          ? (requestRole.deliveryMode as unknown as Role.DeliveryModeEnum)
          : undefined;
        role.signerType = requestRole.signerType
          ? (requestRole.signerType as unknown as Role.SignerTypeEnum)
          : undefined;
        role.signerRole = requestRole.signerRole ?? undefined;
        role.allowFieldConfiguration = requestRole.allowFieldConfiguration ?? undefined;
        role.existingFormFields = requestRole.existingFormFields ?? undefined;
        role.enableQes = requestRole.enableQes ?? undefined;
        roles.push(role);
      });
      return roles;
    }
  • Tool definition with schema and wrapper handler that delegates to the main dynamic handler.
    export const sendDocumentFromTemplateDynamicToolDefinition: BoldSignTool = {
      method: ToolNames.SendDocumentFromTemplate.toString(),
      name: 'Send document from template',
      description:
        'Initiates the process of sending a document based on a pre-defined template. This tool allows you to specify recipients, form field values, and various sending options to create and send a document for signing.',
      inputSchema: SendDocumentFromTemplateSchema,
      async handler(args: unknown): Promise<McpResponse> {
        return await sendDocumentFromTemplateDynamicHandler(args as SendDocumentFromTemplateSchemaType);
      },
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'creates and sends a document for signing,' which implies a write/mutation operation, but doesn't disclose critical behavioral traits: whether this is an irreversible action, what permissions are required, rate limits, error conditions, or what happens after sending (e.g., document status changes). The description is minimal and lacks necessary context for safe invocation.

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 appropriately concise with two sentences that efficiently state the core purpose. It's front-loaded with the main action ('Initiates the process of sending a document based on a pre-defined template') and follows with key capabilities. There's no wasted text, though it could be slightly more structured by separating purpose from capabilities more clearly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of this tool (2 parameters with extensive nested objects, no annotations, no output schema), the description is inadequate. It doesn't explain what happens after successful invocation (e.g., returns a document ID, triggers email notifications), doesn't mention error handling, and provides no context about the sending process lifecycle. For a mutation tool with significant parameter complexity, this minimal description leaves too many gaps for effective agent use.

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 parameters thoroughly. The description adds minimal value beyond the schema, mentioning 'recipients, form field values, and various sending options' which loosely maps to 'roles', 'existingFormFields', and other body properties. However, it doesn't provide additional semantic context, usage examples, or clarify relationships between parameters beyond what's in the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Initiates the process of sending a document based on a pre-defined template' with specific actions like specifying recipients, form field values, and sending options. It distinguishes from siblings like 'list_templates' or 'get_template_properties' by focusing on sending rather than retrieving information. However, it doesn't explicitly differentiate from 'send_reminder_for_document_sign' which is a related but distinct operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a template ID from 'list_templates'), when to use template-based sending versus other document creation methods, or exclusions. The only implicit context is that it's for sending documents from templates, but no explicit usage boundaries are defined.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Synctest-hub/boldsign-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server