nworks_task_create
Create new tasks in LINE WORKS with titles, due dates, and assignees using this task management tool.
Instructions
할 일(TODO)을 새로 만듭니다. '할 일 추가해줘', 'TODO 등록해줘' 등의 요청에 사용. 기본적으로 자기 자신에게 할당. User OAuth 인증 필요 (task + user.read scope)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | 할 일 제목 | |
| content | No | 할 일 내용 | |
| dueDate | No | 마감일 (YYYY-MM-DD) | |
| categoryId | No | 카테고리 ID | |
| assigneeIds | No | 담당자 user ID 목록 (미지정 시 자기 자신) | |
| userId | No | 생성자 user ID (미지정 시 me) |
Implementation Reference
- src/api/task.ts:160-200 (handler)Implementation of `createTask` which handles the API request to create a new task.
export async function createTask(opts: CreateTaskOptions): Promise<Task> { const userId = opts.userId ?? "me"; const profile = opts.profile ?? "default"; const resolvedUserId = await resolveUserId(userId, profile); const assignorId = opts.assignorId ?? resolvedUserId; const assigneeIds = opts.assigneeIds ?? [resolvedUserId]; const body: Record<string, unknown> = { assignorId, assignees: assigneeIds.map((id) => ({ assigneeId: id, status: "TODO" })), title: opts.title, content: opts.content ?? "", completionCondition: "ANY_ONE", }; if (opts.dueDate) body.dueDate = opts.dueDate; if (opts.categoryId) body.categoryId = opts.categoryId; const url = `${BASE_URL}/users/${sanitizePathSegment(userId)}/tasks`; if (process.env["NWORKS_VERBOSE"] === "1") { console.error(`[nworks] POST ${url}`); console.error(`[nworks] Body: ${JSON.stringify(body).length} bytes`); } const res = await authedFetch( url, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body), }, profile ); if (res.status === 201) { return (await res.json()) as Task; } if (!res.ok) return handleError(res); return (await res.json()) as Task; } - src/mcp/tools.ts:678-698 (registration)MCP tool registration for `nworks_task_create` including input validation schema and handler invocation.
server.tool( "nworks_task_create", "할 일(TODO)을 새로 만듭니다. '할 일 추가해줘', 'TODO 등록해줘' 등의 요청에 사용. 기본적으로 자기 자신에게 할당. User OAuth 인증 필요 (task + user.read scope)", { title: z.string().describe("할 일 제목"), content: z.string().optional().describe("할 일 내용"), dueDate: z.string().optional().describe("마감일 (YYYY-MM-DD)"), categoryId: z.string().optional().describe("카테고리 ID"), assigneeIds: z.array(z.string()).optional().describe("담당자 user ID 목록 (미지정 시 자기 자신)"), userId: z.string().optional().describe("생성자 user ID (미지정 시 me)"), }, async ({ title, content, dueDate, categoryId, assigneeIds, userId }) => { try { const result = await taskApi.createTask({ title, content, dueDate, categoryId, assigneeIds, userId: userId ?? "me", });