upload_attachment
Upload a file as a note attachment linked to a party, opportunity, or project. Provide the file as base64-encoded data with filename and content type.
Instructions
Upload a file as a new note attachment, linked to a party, opportunity, or project. Provide the file as base64-encoded dataBase64 along with filename and contentType (MIME). Also provide exactly one of partyId / opportunityId / projectId to anchor the note. Optionally pass content to set the note body (defaults to '[attachment]'). Two-step orchestration server-side: bytes upload → token → note creation. Adding to an existing entry is not supported.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | Body text for the note that will hold the attachment. Defaults to '[attachment]' if omitted. | |
| partyId | No | Link the new note to a party (mutually exclusive with opportunityId / projectId). | |
| filename | Yes | Filename Capsule should record (e.g. 'contract.pdf'). Capsule does NOT validate consistency between filename, contentType, and the actual bytes — a typo in either is accepted and the file is stored as labelled. | |
| projectId | No | ||
| dataBase64 | Yes | File contents, base64-encoded. Decoded server-side and uploaded as the request body. PRACTICAL LIMIT: the base64 must be produced inline as tool-call output, so uploads driven by an LLM are only viable for small files (a few tens of KB) — a 500 KB file is ~660K characters, far beyond a chat model's output budget. Do not attempt to inline large files; tell the user the file is too large to route through the model. The 25 MB maximum (Capsule's documented limit) applies to programmatic MCP clients that construct the call directly; the connector rejects oversized base64 before uploading. | |
| contentType | Yes | MIME type of the file (e.g. 'application/pdf', 'image/png', 'text/plain'). Trusted by Capsule verbatim; not cross-checked against `filename` or the actual bytes. | |
| opportunityId | No |