Skip to main content

Tasks Close By Query

Immutable Catalog Entry

This descriptor comes from the active versioned Portal catalog.

WRITEghl.tasks_close_by_query
  • Contract tier: legacy
  • Risk: write
  • Catalog version: 2026-07-12.2
  • Descriptor hash: 8c963b8b4cbe226ced3710585a1e1332c9538e4b9eec2e20eb47d0a89e41499b

Mark tasks as completed based on a keyword or query. Tasks returned by location search without contactId are skipped because GHL only exposes official task mutation through contact-scoped endpoints. GHL category: Automation. This writes to GoHighLevel and may change account data.

Request Body

{
"jsonrpc": "2.0",
"id": "ghl-tasks-close-by-query-example",
"method": "tools/call",
"params": {
"name": "ghl.tasks_close_by_query",
"arguments": {
"query": "query_example",
"limit": 1,
"dryRun": false,
"maxTasks": 1,
"tenantId": "tenantId_123",
"assignedTo": [],
"locationId": "locationId_123",
"strictTenant": false,
"assignedToNames": [],
"assignedToDiscordIds": []
}
}
}

Arguments Schema

{
"type": "object",
"required": [
"query"
],
"properties": {
"limit": {
"type": "number",
"default": 100,
"description": "Page size for task search (max 100)."
},
"query": {
"type": "string",
"description": "Keyword or query string to match."
},
"dryRun": {
"type": "boolean",
"default": false,
"description": "Preview changes without writing."
},
"maxTasks": {
"type": "number",
"default": 200,
"description": "Maximum tasks to update."
},
"tenantId": {
"type": "string",
"description": "Tenant ID from list_tenants."
},
"assignedTo": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional assigned user IDs to include."
},
"locationId": {
"type": "string",
"description": "Optional. Defaults to the authenticated runtime location; if supplied, it must match that location."
},
"strictTenant": {
"type": "boolean",
"default": true,
"description": "Require tenantId to match locationId routing (default: true)."
},
"assignedToNames": {
"type": "array",
"items": {
"type": "string"
},
"description": "Names/handles to resolve via team directory."
},
"assignedToDiscordIds": {
"type": "array",
"items": {
"type": "string"
},
"description": "Discord IDs to include (resolved via team directory)."
}
},
"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-tasks-close-by-query-example",
"method": "tools/call",
"params": {
"name": "ghl.tasks_close_by_query",
"arguments": {
"query": "query_example",
"limit": 1,
"dryRun": false,
"maxTasks": 1,
"tenantId": "tenantId_123",
"assignedTo": [],
"locationId": "locationId_123",
"strictTenant": false,
"assignedToNames": [],
"assignedToDiscordIds": []
}
}
}'

Example Responses

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