Skip to main content
Glama

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
NameRequiredDescriptionDefault
titleYes할 일 제목
contentNo할 일 내용
dueDateNo마감일 (YYYY-MM-DD)
categoryIdNo카테고리 ID
assigneeIdsNo담당자 user ID 목록 (미지정 시 자기 자신)
userIdNo생성자 user ID (미지정 시 me)

Implementation Reference

  • 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;
    }
  • 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",
          });

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/yjcho9317/nworks'

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