Skip to main content
Glama

upsert_contact

Create or update contacts by channel and platform user ID; omitted fields stay unchanged for existing contacts, and new tags are added if missing.

Instructions

Create or update a contact. Upsert keyed by (channel, platform_user_id). 201 when created, 200 when an existing contact was updated. Fields you omit on an existing contact are left untouched, tags included.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "channel": "<channel>",
      "platform_user_id": "<platform_user_id>"
    },
    "name": "upsert_contact"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNo
tagsNoTag names, created if missing.
emailNo
notesNo
phoneNo
stageNo
channelYes
custom_fieldsNo
platform_user_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds real behavior beyond the annotations: HTTP status semantics (201 created vs 200 updated), upsert keying, and the partial-write rule that omitted fields including tags are preserved. One tension: the annotations set idempotentHint=false while 'upsert keyed by' implies repeated identical calls converge on the same state, and the description never resolves which interpretation an agent should trust.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short sentences, front-loaded with the create-or-update verb and the keying rule, with zero filler. Each sentence adds a distinct fact (key, status codes, partial-update semantics).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 9 parameters, a nested custom_fields object, no output schema, and near-zero schema coverage, this mutation tool needs more than four sentences. The key and merge-by-omission behavior are covered well, but nested-object merge semantics and per-field constraints (enum values for stage/channel, maxLengths) remain undocumented on the description side.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 11% (only tags is documented inline), so the description has to carry the load. It explains the two required parameters as a composite key and clarifies that omitted fields are left untouched, but it says nothing about name, email, phone, stage, or — most importantly — whether custom_fields is merged or wholesale replaced.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Create or update a contact" gives a specific verb pair and resource, and "Upsert keyed by (channel, platform_user_id)" tells an agent exactly which identity determines create-vs-update, which is the crucial distinction from the sibling update_contact. It stops short of naming update_contact as the alternative, so the boundary must still be inferred.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied rather than stated: the upsert key implies 'use this when you only have channel + platform_user_id,' and the side-effect note implies repeated calls are safe for partial payloads. There is no explicit when-not guidance and no mention of update_contact, create_tag/tag_contact, or what happens if you have an internal contact id instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools