upload_and_attach_document
Upload PDF or DOCX files to attach them to digital signature envelopes for signing workflows.
Instructions
Upload a local file (PDF/DOCX) and attach it to an envelope.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| envelopeId | Yes | Envelope UUID | |
| filePath | Yes | Absolute path to the file to upload | |
| documentName | No | Display name for the document |
Implementation Reference
- src/index.js:179-199 (handler)The 'upload_and_attach_document' tool is registered and implemented in src/index.js. The handler takes envelopeId, filePath, and an optional documentName, then calls api.uploadFile and api.addDocument to complete the operation.
server.tool( 'upload_and_attach_document', 'Upload a local file (PDF/DOCX) and attach it to an envelope.', { envelopeId: z.string().describe('Envelope UUID'), filePath: z.string().describe('Absolute path to the file to upload'), documentName: z.string().optional().describe('Display name for the document'), }, async ({ envelopeId, filePath, documentName }) => { try { const path = await import('node:path'); const file = await api.uploadFile(creds, filePath); const doc = await api.addDocument(creds, envelopeId, { fileId: file.id, name: documentName || path.basename(filePath), }); return result({ file, document: doc }); } catch (err) { return errorResult(err); } }