Upsert Opportunity
Immutable Catalog Entry
This descriptor comes from the active versioned Portal catalog.
- Contract tier:
agent_ready - Risk:
write - Catalog version:
2026-07-12.2 - Descriptor hash:
8d5ce2adb06fcdb9b8efe270f92dbb3f0ca28d01033a29fe16353cda28929ba8
Create or update an opportunity based on contact and pipeline (smart merge) GHL category: Opportunities. This writes to GoHighLevel and may change account data.
Request Body
{
"jsonrpc": "2.0",
"id": "ghl-upsert-opportunity-example",
"method": "tools/call",
"params": {
"name": "ghl.upsert_opportunity",
"arguments": {
"pipelineId": "pipelineId_123",
"contactId": "contactId_123",
"name": "name_example",
"status": "open",
"tenantId": "tenantId_123",
"assignedTo": "assignedTo_example",
"monetaryValue": 1,
"pipelineStageId": "pipelineStageId_123"
}
}
}
Arguments Schema
{
"type": "object",
"required": [
"pipelineId",
"contactId"
],
"properties": {
"name": {
"type": "string",
"description": "Name/title of the opportunity"
},
"status": {
"enum": [
"open",
"won",
"lost",
"abandoned"
],
"type": "string",
"default": "open",
"description": "Status of the opportunity"
},
"tenantId": {
"type": "string",
"description": "Tenant ID from list_tenants."
},
"contactId": {
"type": "string",
"description": "ID of the contact associated with this opportunity"
},
"assignedTo": {
"type": "string",
"description": "User ID to assign this opportunity to"
},
"pipelineId": {
"type": "string",
"description": "ID of the pipeline this opportunity belongs to"
},
"monetaryValue": {
"type": "number",
"description": "Monetary value of the opportunity in dollars"
},
"pipelineStageId": {
"type": "string",
"description": "Pipeline stage ID"
}
}
}
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
- Node.js
- Python
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-upsert-opportunity-example",
"method": "tools/call",
"params": {
"name": "ghl.upsert_opportunity",
"arguments": {
"pipelineId": "pipelineId_123",
"contactId": "contactId_123",
"name": "name_example",
"status": "open",
"tenantId": "tenantId_123",
"assignedTo": "assignedTo_example",
"monetaryValue": 1,
"pipelineStageId": "pipelineStageId_123"
}
}
}'
const response = await fetch('https://portal.madpanda3d.com/api/mcp', {
method: 'POST',
headers: {
Authorization: 'Bearer mad_live_***',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"jsonrpc": "2.0",
"id": "ghl-upsert-opportunity-example",
"method": "tools/call",
"params": {
"name": "ghl.upsert_opportunity",
"arguments": {
"pipelineId": "pipelineId_123",
"contactId": "contactId_123",
"name": "name_example",
"status": "open",
"tenantId": "tenantId_123",
"assignedTo": "assignedTo_example",
"monetaryValue": 1,
"pipelineStageId": "pipelineStageId_123"
}
}
}),
});
const data = await response.json();
console.log(data);
import requests
url = 'https://portal.madpanda3d.com/api/mcp'
headers = {
'Authorization': 'Bearer mad_live_***',
'Content-Type': 'application/json',
}
payload = {
"jsonrpc": "2.0",
"id": "ghl-upsert-opportunity-example",
"method": "tools/call",
"params": {
"name": "ghl.upsert_opportunity",
"arguments": {
"pipelineId": "pipelineId_123",
"contactId": "contactId_123",
"name": "name_example",
"status": "open",
"tenantId": "tenantId_123",
"assignedTo": "assignedTo_example",
"monetaryValue": 1,
"pipelineStageId": "pipelineStageId_123"
}
}
}
response = requests.post(url, headers=headers, json=payload, timeout=60)
print(response.json())
Example Responses
- 200 Success
- 502 Upstream Error
{
"ok": true,
"message": "Tool ghl.upsert_opportunity executed successfully.",
"note": "Response shape varies by MCP tool. Inspect live responses for exact fields."
}
{
"ok": false,
"classification": "upstream_http_error",
"message": "Upstream MCP returned a non-success status."
}