Skip to main content
Glama

send_document

Send documents for two-party electronic signing. Converts markdown to PDF, emails signing links to recipients, and delivers SHA-256 certified signed copies to both parties.

Instructions

Send a document for two-party e-signing. Converts markdown to PDF, verifies the sender, emails the recipient a signing link, and delivers a SHA-256 certified signed copy to both parties.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
markdownYesDocument content in markdown format. This will be converted to a professional PDF.
titleNoDocument title. If omitted, extracted from the first markdown heading.
sender_nameYesFull name of the document sender
sender_emailYesEmail address of the sender
recipient_nameYesFull name of the document recipient
recipient_emailYesEmail address of the recipient
expires_in_daysNoDays until the signing link expires. Default: 7

Implementation Reference

  • Handler function for send_document tool - makes POST request to SignBee API, handles responses for both verified and unverified senders, and returns formatted success/error messages
    async (params) => {
      try {
        const body: Record<string, unknown> = {
          markdown: params.markdown,
          sender_name: params.sender_name,
          sender_email: params.sender_email,
          recipient_name: params.recipient_name,
          recipient_email: params.recipient_email,
        };
    
        if (params.title) body.title = params.title;
        if (params.expires_in_days) body.expires_in_days = params.expires_in_days;
    
        const headers: Record<string, string> = {
          "Content-Type": "application/json",
        };
    
        if (SIGNBEE_API_KEY) {
          headers["Authorization"] = `Bearer ${SIGNBEE_API_KEY}`;
        }
    
        const response = await fetch(`${SIGNBEE_API_URL}/api/v1/send`, {
          method: "POST",
          headers,
          body: JSON.stringify(body),
        });
    
        const data = await response.json();
    
        if (!response.ok) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Error (${response.status}): ${JSON.stringify(data)}`,
              },
            ],
            isError: true,
          };
        }
    
        const status = data.status;
        let summary: string;
    
        if (status === "pending_recipient") {
          summary = [
            `✅ Document sent successfully!`,
            ``,
            `📄 Document ID: ${data.document_id}`,
            `👤 Sender: ${data.sender} (pre-verified via API key)`,
            `📩 Recipient: ${data.recipient}`,
            `⏰ Expires: ${data.expires_at}`,
            ``,
            `The recipient has been emailed a signing link.`,
          ].join("\n");
        } else if (status === "pending_sender") {
          summary = [
            `📧 Verification required`,
            ``,
            `📄 Document ID: ${data.document_id}`,
            `📩 ${data.message}`,
            ``,
            `The sender must verify their email before the document is sent to the recipient.`,
            ``,
            `💡 Tip: Set the SIGNBEE_API_KEY environment variable to skip sender verification.`,
            `   Get your API key at: https://signb.ee/dashboard`,
          ].join("\n");
        } else {
          summary = JSON.stringify(data, null, 2);
        }
    
        return {
          content: [{ type: "text" as const, text: summary }],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text" as const,
              text: `Failed to send document: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Zod schema defining input validation for send_document tool: markdown content, title (optional), sender/recipient details, and expiration days (optional)
    {
      markdown: z
        .string()
        .min(10)
        .describe(
          "Document content in markdown format. This will be converted to a professional PDF."
        ),
      title: z
        .string()
        .optional()
        .describe(
          "Document title. If omitted, extracted from the first markdown heading."
        ),
      sender_name: z.string().describe("Full name of the document sender"),
      sender_email: z
        .string()
        .email()
        .describe("Email address of the sender"),
      recipient_name: z
        .string()
        .describe("Full name of the document recipient"),
      recipient_email: z
        .string()
        .email()
        .describe("Email address of the recipient"),
      expires_in_days: z
        .number()
        .int()
        .min(1)
        .max(30)
        .optional()
        .describe(
          "Days until the signing link expires. Default: 7"
        ),
    },
  • src/index.ts:16-18 (registration)
    Tool registration with server.tool() - registers 'send_document' tool name and description for sending documents for e-signing
    // --- Tool: send_document ---
    server.tool(
      "send_document",
Behavior4/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 effectively describes the multi-step workflow (markdown conversion, sender verification, email delivery, SHA-256 certification) and the outcome (signed copy to both parties), though it doesn't mention error conditions, rate limits, or authentication requirements.

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?

The description is a single, well-structured sentence that efficiently communicates the complete workflow. Every clause adds essential information about the tool's functionality with zero wasted words, making it highly front-loaded and easy to parse.

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 tool with 7 parameters, 100% schema coverage, and no output schema, the description provides strong contextual completeness by explaining the multi-step process and outcome. It could be slightly improved by mentioning error handling or authentication, but covers the core functionality well given the structured data available.

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%, providing comprehensive parameter documentation. The description adds value by explaining the overall workflow context and that markdown converts to PDF, but doesn't provide additional parameter semantics beyond what the schema already documents effectively.

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 clearly states the specific action ('Send a document for two-party e-signing') and resource ('document'), distinguishing it from the sibling tool 'send_document_pdf' by specifying e-signing functionality rather than just PDF sending. It provides a comprehensive overview of the multi-step process involved.

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

Usage Guidelines3/5

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

The description implies usage context (two-party e-signing with markdown conversion), but doesn't explicitly state when to use this tool versus the sibling 'send_document_pdf' or other alternatives. It provides functional context but lacks comparative guidance.

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/signbee/mcp'

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