set_task_name
Update a task's name by supplying the new name and optionally locating it via current name, task ID, or series ID.
Instructions
Rename a task.
Args: new_name: New name for the task task_name: Current task name to search for task_id: Specific task ID taskseries_id: Task series ID list_id: List ID
Returns: Updated task details
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new_name | Yes | ||
| task_name | No | ||
| task_id | No | ||
| taskseries_id | No | ||
| list_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/rtm_mcp/tools/tasks.py:341-384 (handler)Handler function for the 'set_task_name' tool. Renames a task by calling rtm.tasks.setName. Resolves task IDs via _resolve_task_ids, returns updated task details.
@mcp.tool() async def set_task_name( ctx: Context, new_name: str, task_name: str | None = None, task_id: str | None = None, taskseries_id: str | None = None, list_id: str | None = None, ) -> dict[str, Any]: """Rename a task. Args: new_name: New name for the task task_name: Current task name to search for task_id: Specific task ID taskseries_id: Task series ID list_id: List ID Returns: Updated task details """ client: RTMClient = await get_client() ids = await _resolve_task_ids(client, task_name, task_id, taskseries_id, list_id) if "error" in ids: return build_response(data=ids) result = await client.call( "rtm.tasks.setName", require_timeline=True, name=new_name, **ids, ) tasks = parse_tasks_response(result) task_data = tasks[0] if tasks else {} timezone = await _get_user_timezone(client) return build_response( data={ "task": format_task(task_data, timezone=timezone), "message": f"Renamed to: {new_name}", }, transaction_id=get_transaction_id(result), ) - src/rtm_mcp/tools/tasks.py:350-361 (schema)Docstring acting as schema for input parameters (new_name required, task_name/task_id/taskseries_id/list_id optional) and return type.
"""Rename a task. Args: new_name: New name for the task task_name: Current task name to search for task_id: Specific task ID taskseries_id: Task series ID list_id: List ID Returns: Updated task details """ - src/rtm_mcp/server.py:103-103 (registration)Registration point: register_task_tools(mcp, get_client) is called, which registers set_task_name as an MCP tool via @mcp.tool() decorator inside the function.
register_task_tools(mcp, get_client) - src/rtm_mcp/tools/tasks.py:17-17 (registration)register_task_tools function that registers all task tools including set_task_name via @mcp.tool() decorator.
def register_task_tools(mcp: Any, get_client: Any) -> None: - src/rtm_mcp/tools/tasks.py:895-920 (helper)Helper function _resolve_task_ids used by set_task_name to resolve task identifiers by name or IDs.
async def _resolve_task_ids( client: RTMClient, task_name: str | None, task_id: str | None, taskseries_id: str | None, list_id: str | None, ) -> dict[str, Any]: """Resolve task identifiers, searching by name if needed.""" if task_name and not task_id: task = await _find_task(client, task_name) if not task: return {"error": f"Task not found: {task_name}"} return { "task_id": task["id"], "taskseries_id": task["taskseries_id"], "list_id": task["list_id"], } if not all([task_id, taskseries_id, list_id]): return {"error": "Must provide task_name or all three IDs"} return { "task_id": task_id, "taskseries_id": taskseries_id, "list_id": list_id, }