TencentCloud/TencentDB-Agent-Memory · error · ParamError

name or prompt is required

Error message

name or prompt is required

What it means

update() refuses to issue a request when both name and prompt are None, since an update call with no changed fields would be a no-op and likely masks a bug. At least one of the two fields must be provided. memory_prompt_id itself is separately validated by _required().

Source

Thrown at sdk/memory-core/python/tencentdb_agent_memory/v3/memory_prompt.py:80

        return self._get(f"{_ROOT}/get", {"memory_prompt_id": _required("memory_prompt_id", memory_prompt_id)})

    def list(self, *, layer: Optional[str] = None, limit: Optional[int] = None,
             offset: Optional[int] = None, time_order: Optional[str] = None) -> Dict[str, Any]:
        return self._get(f"{_ROOT}/get", _strip_none({
            "layer": layer, "limit": limit, "offset": offset, "time_order": time_order,
        }))

    def get_effective(self, *, layer: str, team_id: Optional[str] = None,
                      agent_id: Optional[str] = None) -> Dict[str, Any]:
        team, agent = team_id or self._team_id, agent_id or self._agent_id
        if not team:
            raise ParamError("team_id is required for effective prompt lookup")
        return self._get(f"{_ROOT}/get", _strip_none({"team_id": team, "agent_id": agent, "layer": layer}))

    def update(self, memory_prompt_id: str, *, name: Optional[str] = None,
               prompt: Optional[str] = None) -> Dict[str, Any]:
        if name is None and prompt is None:
            raise ParamError("name or prompt is required")
        return self._stub.post(f"{_ROOT}/update", _strip_none({
            "memory_prompt_id": _required("memory_prompt_id", memory_prompt_id), "name": name, "prompt": prompt,
        }))

    def delete(self, memory_prompt_ids: Iterable[str]) -> Dict[str, Any]:
        return self._stub.post(f"{_ROOT}/delete", {"memory_prompt_ids": _ids(memory_prompt_ids, "memory_prompt_ids")})

    def apply(self, memory_prompt_id: str, *, layer: str, team_id: Optional[str] = None,
              agent_ids: Optional[List[str]] = None) -> Dict[str, Any]:
        team = team_id or self._team_id
        _target(team, agent_ids)
        return self._stub.post(f"{_ROOT}/set", _strip_none({
            "action": "apply", "memory_prompt_id": _required("memory_prompt_id", memory_prompt_id),
            "team_id": team, "agent_ids": agent_ids, "layer": layer,
        }))

    def clear(self, *, layer: str, team_id: Optional[str] = None,
              agent_ids: Optional[List[str]] = None) -> Dict[str, Any]:

View on GitHub (pinned to 3efcd317b8)

Solutions

  1. Pass at least one field: update(pid, prompt="new text") or update(pid, name="new name").
  2. Guard the call site: skip the update entirely when both values are None.
  3. Validate user input so at least one editable field is populated before invoking update().

Example fix

# before
fields = {"name": form.get("name"), "prompt": form.get("prompt")}
client.update(prompt_id, **fields)  # raises when both absent

# after
fields = {k: v for k, v in (("name", form.get("name")), ("prompt", form.get("prompt"))) if v is not None}
if not fields:
    return  # nothing to update
client.update(prompt_id, **fields)
Defensive patterns

Strategy: validation

Validate before calling

changes = {k: v for k, v in (("name", name), ("prompt", prompt)) if v is not None}
if changes:
    client.update(memory_prompt_id, **changes)

Type guard

def has_update_payload(name: object, prompt: object) -> bool:
    return name is not None or prompt is not None

Try / catch

try:
    client.update(pid, name=name, prompt=prompt)
except ParamError as e:
    logging.info("Skipping update, no fields provided: %s", e)

Prevention

When it happens

Trigger: Calling update("<prompt-id>") with no keyword arguments, or passing name=None, prompt=None (e.g. from variables that both resolved to None).

Common situations: Generic edit handlers whose name/prompt values come from optional form fields left blank; code paths where only metadata unrelated to name/prompt was intended to change; typos like prompt="" being stripped to None upstream.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of TencentCloud/TencentDB-Agent-Memory@3efcd317b8 (2026-09-01). Data as JSON: /api/errors/eb85f1dd5fee9f8e. Report an issue: GitHub.