Skip to main content

Forms Upload Custom Files

Immutable Catalog Entry

This descriptor comes from the active versioned Portal catalog.

WRITEghl.forms_upload_custom_files
  • Contract tier: agent_ready
  • Risk: write
  • Catalog version: 2026-07-12.2
  • Descriptor hash: 38239ced4684fe97368dac56a49aac44c427c2e3373119bafc02c1e7d0f99490

Upload owned files to GHL contact custom file fields through Forms. GHL category: Sites / Forms. Use remote-agent-safe inputs only: fileUrl, dataUrl, or base64. Do not pass local filesystem paths from your own machine. The GHL field name is built as customFieldId_fileId, and files are limited to 50 MB with the official allowed extensions.

Request Body

{
"jsonrpc": "2.0",
"id": "ghl-forms-upload-custom-files-example",
"method": "tools/call",
"params": {
"name": "ghl.forms_upload_custom_files",
"arguments": {
"contactId": "contactId_123",
"files": [],
"tenantId": "tenantId_123",
"locationId": "locationId_123",
"strictTenant": false,
"includeContactDetails": false
}
}
}

Arguments Schema

{
"type": "object",
"required": [
"contactId",
"files"
],
"properties": {
"files": {
"type": "array",
"items": {
"type": "object",
"required": [
"customFieldId"
],
"properties": {
"base64": {
"type": "string",
"description": "Raw base64 file content. Provide fileName and contentType for best results."
},
"fileId": {
"type": "string",
"description": "Optional stable file ID portion for the multipart field key. Defaults to a generated UUID."
},
"dataUrl": {
"type": "string",
"description": "Data URL containing file content, for example data:image/png;base64,..."
},
"fileUrl": {
"type": "string",
"description": "Remote HTTP(S) URL to fetch server-side and upload. Local paths and file:// URLs are rejected."
},
"fileName": {
"type": "string",
"description": "Filename to send to GHL, including an allowed extension such as pdf, jpg, png, csv, xlsx, mp4, zip, txt, or svg."
},
"contentType": {
"type": "string",
"description": "MIME type to attach to the upload payload. Inferred from dataUrl or filename when omitted."
},
"customFieldId": {
"type": "string",
"description": "GHL custom file field ID. The multipart field key is customFieldId_fileId."
}
},
"additionalProperties": false
},
"maxItems": 10,
"minItems": 1,
"description": "Files to upload. Each item must specify customFieldId and exactly one input mode: fileUrl, dataUrl, or base64."
},
"tenantId": {
"type": "string",
"description": "Tenant ID from list_tenants."
},
"contactId": {
"type": "string",
"description": "GHL contact ID whose custom file field should receive the uploaded file."
},
"locationId": {
"type": "string",
"description": "Optional GHL location ID. If provided, it must match the authenticated runtime location; otherwise the runtime location is used."
},
"strictTenant": {
"type": "boolean",
"default": true,
"description": "Require tenantId to match locationId routing (default: true)."
},
"includeContactDetails": {
"type": "boolean",
"default": false,
"description": "Defaults to false. When false, returns upload metadata and a compact contact update signal instead of the full updated contact object."
}
},
"additionalProperties": false
}

Output Schema

{
"type": "object",
"required": [
"ok",
"data",
"error",
"meta"
],
"properties": {
"ok": {
"type": "boolean",
"description": "Whether the GHL MCP operation completed successfully."
},
"data": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "array",
"items": {}
},
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Tool-specific GHL or local navigation result when ok is true."
},
"meta": {
"type": "object",
"description": "Safe execution, routing, and timing metadata.",
"additionalProperties": true
},
"error": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"description": "Safe error details when ok is false; credential values are never returned."
}
},
"description": "Normalized GHL MCP response envelope.",
"additionalProperties": false
}

Code Examples

curl -X POST 'https://portal.madpanda3d.com/api/mcp' \
-H 'Authorization: Bearer mad_live_***' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": "ghl-forms-upload-custom-files-example",
"method": "tools/call",
"params": {
"name": "ghl.forms_upload_custom_files",
"arguments": {
"contactId": "contactId_123",
"files": [],
"tenantId": "tenantId_123",
"locationId": "locationId_123",
"strictTenant": false,
"includeContactDetails": false
}
}
}'

Example Responses

{
"ok": true,
"message": "Tool ghl.forms_upload_custom_files executed successfully.",
"note": "Response shape varies by MCP tool. Inspect live responses for exact fields."
}