MCPcopy Index your code
hub / github.com/plotly/dash / parse_task_id

Function parse_task_id

dash/mcp/tasks/tasks.py:19–27  ·  view source on GitHub ↗

Parse a taskId into (tool_name, job_id, cache_key, created_at).

(task_id: str)

Source from the content-addressed store, hash-verified

17
18
19def parse_task_id(task_id: str) -> tuple[str, str, str, datetime]:
20 """Parse a taskId into (tool_name, job_id, cache_key, created_at)."""
21 try:
22 tool_name, job_id, rest = task_id.split(":", 2)
23 cache_key, created_epoch = rest.rsplit(":", 1)
24 created_at = datetime.fromtimestamp(int(created_epoch), tz=timezone.utc)
25 except (ValueError, TypeError) as exc:
26 raise MCPError(f"Malformed taskId: {task_id!r}") from exc
27 return tool_name, job_id, cache_key, created_at
28
29
30def _get_callback_manager(tool_name: str):

Callers 3

get_taskFunction · 0.85
get_task_resultFunction · 0.85
cancel_taskFunction · 0.85

Calls 1

MCPErrorClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…