Skip to main content
Glama

create_task

Add tasks to Dida365 with details like title, project, due date, priority, and tags. Tasks without a project go to the inbox.

Instructions

创建新任务。可以指定标题、所属项目、截止日期、优先级、标签等。不指定项目则放入收集箱。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes任务标题
project_idNo项目ID(可选,不填则放入收集箱)
contentNo任务内容/描述(可选)
start_dateNo开始日期(可选,ISO 8601格式,如 '2026-03-15T09:00:00+0800')
due_dateNo截止日期(可选,ISO 8601格式,如 '2026-03-15T18:00:00+0800')
priorityNo优先级(0=无, 1=低, 3=中, 5=高)
is_all_dayNo是否全天任务(可选)
tagsNo标签列表(可选)

Implementation Reference

  • Implementation of the create_task tool logic in the DidaClient class, which makes the HTTP request to the Dida365 API to create a task.
    def create_task(
        self,
        title: str,
        project_id: Optional[str] = None,
        content: Optional[str] = None,
        desc: Optional[str] = None,
        start_date: Optional[str] = None,
        due_date: Optional[str] = None,
        priority: int = 0,
        is_all_day: Optional[bool] = None,
        time_zone: Optional[str] = None,
        tags: Optional[List[str]] = None,
    ) -> Dict:
        """
        创建新任务
    
        Args:
            title: 任务标题
            project_id: 项目ID(不填则放入收集箱)
            content: 任务内容/描述
            desc: 纯文本描述
            start_date: 开始日期 (ISO 8601, 例如: "2026-03-15T09:00:00+0800")
            due_date: 截止日期 (ISO 8601)
            priority: 优先级 (0=无, 1=低, 3=中, 5=高)
            is_all_day: 是否全天任务
            time_zone: 时区(例如 "Asia/Shanghai")
            tags: 标签列表
        """
        data: Dict[str, Any] = {"title": title}
    
        if project_id:
            data["projectId"] = project_id
        if content:
            data["content"] = content
        if desc:
            data["desc"] = desc
        if start_date:
            data["startDate"] = start_date
        if due_date:
            data["dueDate"] = due_date
        if priority:
            data["priority"] = priority
        if is_all_day is not None:
            data["isAllDay"] = is_all_day
        if time_zone:
            data["timeZone"] = time_zone
        else:
            data["timeZone"] = "Asia/Shanghai"
        if tags:
            data["tags"] = tags
    
        response = self.client.post("/task", json=data)
        response.raise_for_status()
        return response.json()
  • Schema definition for the create_task tool, specifying input arguments and descriptions.
        "name": "create_task",
        "description": "创建新任务。可以指定标题、所属项目、截止日期、优先级、标签等。不指定项目则放入收集箱。",
        "inputSchema": {
            "type": "object",
            "properties": {
                "title": {"type": "string", "description": "任务标题"},
                "project_id": {
                    "type": "string",
                    "description": "项目ID(可选,不填则放入收集箱)",
                },
                "content": {
                    "type": "string",
                    "description": "任务内容/描述(可选)",
                },
                "start_date": {
                    "type": "string",
                    "description": "开始日期(可选,ISO 8601格式,如 '2026-03-15T09:00:00+0800')",
                },
                "due_date": {
                    "type": "string",
                    "description": "截止日期(可选,ISO 8601格式,如 '2026-03-15T18:00:00+0800')",
                },
                "priority": {
                    "type": "integer",
                    "description": "优先级(0=无, 1=低, 3=中, 5=高)",
                    "enum": [0, 1, 3, 5],
                },
                "is_all_day": {
                    "type": "boolean",
                    "description": "是否全天任务(可选)",
                },
                "tags": {
                    "type": "array",
                    "items": {"type": "string"},
                    "description": "标签列表(可选)",
                },
            },
            "required": ["title"],
        },
    },
  • Tool dispatching logic in the server that maps the 'create_task' request to the client method.
    elif name == "create_task":
        task = client.create_task(
            title=args["title"],
            project_id=args.get("project_id"),
            content=args.get("content"),
            start_date=args.get("start_date"),
            due_date=args.get("due_date"),
            priority=args.get("priority", 0),
            is_all_day=args.get("is_all_day"),
            tags=args.get("tags"),
        )
        return "✅ 任务创建成功!\n\n%s" % format_task(task)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Martinqi826/dida-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server