TencentCloud/TencentDB-Agent-Memory · error · ParamError
team_id is required with agent_id
Error message
team_id is required with agent_id
What it means
list_settings allows filtering by team, by team+agent, or by prompt id, but an agent_id alone is not a valid scope: agents belong to teams, so the API requires team_id whenever agent_id is set. The client checks this (after resolving instance defaults) and raises ParamError for the agent-without-team combination.
Source
Thrown at sdk/memory-core/python/tencentdb_agent_memory/v3/memory_prompt.py:112
"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]:
team = team_id or self._team_id
_target(team, agent_ids)
return self._stub.post(f"{_ROOT}/set", _strip_none({
"action": "clear", "team_id": team, "agent_ids": agent_ids, "layer": layer,
}))
def list_settings(self, *, memory_prompt_id: Optional[str] = None,
target_type: Optional[str] = None, team_id: Optional[str] = None,
agent_id: Optional[str] = None, layer: Optional[str] = None,
limit: Optional[int] = None, offset: Optional[int] = None,
time_order: Optional[str] = None) -> Dict[str, Any]:
team, agent = team_id or self._team_id, agent_id or self._agent_id
if agent and not team:
raise ParamError("team_id is required with agent_id")
return self._get(f"{_ROOT}/setting/list", _strip_none({
"memory_prompt_id": memory_prompt_id, "target_type": target_type,
"team_id": team, "agent_id": agent, "layer": layer,
"limit": limit, "offset": offset, "time_order": time_order,
}))
def list_setting_logs(self, *, memory_prompt_id: Optional[str] = None,
start_time: Optional[str] = None, end_time: Optional[str] = None,
team_id: Optional[str] = None, agent_id: Optional[str] = None,
action: Optional[str] = None, limit: Optional[int] = None,
offset: Optional[int] = None, time_order: Optional[str] = None) -> Dict[str, Any]:
team, agent = team_id or self._team_id, agent_id or self._agent_id
if agent and not team:
raise ParamError("team_id is required with agent_id")
if not memory_prompt_id and not team and not agent:
raise ParamError("memory_prompt_id or a target condition is required")
return self._get(f"{_ROOT}/log", _strip_none({
"memory_prompt_id": memory_prompt_id, "start_time": start_time, "end_time": end_time,View on GitHub (pinned to 3efcd317b8)
Solutions
- Add team_id to the call: list_settings(agent_id="a1", team_id="my-team").
- Provide team_id alone if you want all settings for the team.
- Construct the client with a default team_id so it pairs with the agent_id default.
Example fix
# before client.list_settings(agent_id="agent-1") # raises # after client.list_settings(agent_id="agent-1", team_id="my-team")
Defensive patterns
Strategy: validation
Validate before calling
if agent_id and not (team_id or client._team_id):
raise ValueError("team_id must accompany agent_id")
client.list_settings(memory_prompt_id=pid, team_id=team_id, agent_id=agent_id) Type guard
def valid_target(team_id: object, agent_id: object) -> bool:
return not (agent_id and not team_id) Try / catch
try:
settings = client.list_settings(agent_id=agent_id, team_id=team_id)
except ParamError as e:
logging.error("Invalid target scope for list_settings: %s", e)
settings = [] Prevention
- Treat (team_id, agent_id) as an atomic pair in all list/filter calls.
- Resolve the team from your agent registry before calling list_settings.
- Set team_id as an instance default on the client.
When it happens
Trigger: Calling list_settings(agent_id="a1") (or constructing the client with only agent_id and calling list_settings()) without any team_id argument.
Common situations: Developer knows the agent but not its parent team; instance-level agent_id default was set at construction while team_id was omitted; agent IDs copied from another environment where the team mapping changed.
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
- team_id is required for effective prompt lookup
- {name} must be a non-empty string
- {name} must be a non-empty string
- {name} must be a non-empty list of non-empty strings
- team_id is required with agent_ids
AI-assisted analysis of TencentCloud/TencentDB-Agent-Memory@3efcd317b8 (2026-09-01).
Data as JSON: /api/errors/bc4d71632986e4cb.
Report an issue: GitHub.