SuperAPI AI Directory

wecomcli-manage-schedule

Office & productivity

View repository

Updated 10-16 09:45

About this skill

WeCom schedule management skill

wecom-cli is a command-line program provided by WeCom. All operations are completed by executing wecom-cli commands.

Through wecom-cli schedule <接口名> '<json入参>' to interact with the WeCom schedule system.

Notes

  • Schedule list queries only support30 days before and after the current day, time format YYYY-MM-DD or YYYY-MM-DD HH:MM:SS
  • When participants' userids are involved, first use the wecomcli-lookup-contact skill to obtain them; if there are duplicate names, show candidates for the user to choose (do not expose userid)
  • Before creating/modifying/canceling, first confirm the target schedule and participant information
  • errcode != 0 display an error message when ; the returned start_time/end_time is a Unix timestamp (seconds), which needs to be converted to a readable format
  • Pay attention to time format conversion: API input parameters use string format (such as YYYY-MM-DD HH:MM:SS), but return values are mostly Unix timestamps, and format conversion is required when using them

API list

get_schedule_list_by_range — query schedule ID list

wecom-cli schedule get_schedule_list_by_range '{"start_time": "YYYY-MM-DD HH:MM:SS", "end_time": "YYYY-MM-DD HH:MM:SS"}'

Return schedule_id_list array. Only supports 30 days before and after the current day.

get_schedule_detail — get schedule details

wecom-cli schedule get_schedule_detail '{"schedule_id_list": ["SCHEDULE_ID_1", "SCHEDULE_ID_2"]}'

Supports 1~50 IDs, returns schedule title, time, location, participants, etc. See API details。

create_schedule — create schedule

wecom-cli schedule create_schedule '{"schedule": {"start_time": "YYYY-MM-DD HH:MM:SS", "end_time": "YYYY-MM-DD HH:MM:SS", "summary": "日程标题", "attendees": [{"userid": "USER_ID"}], "reminders": {"is_remind": 1, "remind_before_event_secs": 3600, "timezone": 8}}}'

See API details | reminders field。

update_schedule — modify schedule

Only pass in the fields to be modified; fields not passed remain unchanged.

wecom-cli schedule update_schedule '{"schedule": {"schedule_id": "SCHEDULE_ID", "summary": "更新后的标题"}}'

See API details。

cancel_schedule — cancel schedule

wecom-cli schedule cancel_schedule '{"schedule_id": "SCHEDULE_ID"}'

add_schedule_attendees / del_schedule_attendees — manage participants

  • Add participants:
wecom-cli schedule add_schedule_attendees '{"schedule_id": "SCHEDULE_ID", "attendees": [{"userid": "USER_ID"}]}'
  • Remove participants:
wecom-cli schedule del_schedule_attendees '{"schedule_id": "SCHEDULE_ID", "attendees": [{"userid": "USER_ID"}]}'

check_availability — query free/busy

wecom-cli schedule check_availability '{"check_user_list": ["USER_ID_1", "USER_ID_2"], "start_time": "YYYY-MM-DD HH:MM:SS", "end_time": "YYYY-MM-DD HH:MM:SS"}'

Supports 1~10 users, returns each user's list of busy periods. See API details。


Typical workflow

Query schedules

Classic query examples:

  • "What schedules do I have today?"
  • "Help me check whether there is a meeting this Wednesday afternoon"
  • "What is tomorrow's schedule?"
  • "Check whether there are any schedules about project review recently"
  • "What schedules do I have from next Monday to Friday?"

Process:

  1. Calculate the time range according to the user's intent (e.g., "today"→00:00:00 to 23:59:59 of the current day, "this week"→Monday to Sunday of this week)
  2. Call get_schedule_list_by_range to get the schedule ID list
  3. Call get_schedule_detail to batch retrieve details, and convert Unix timestamps to readable time
  4. If the user mentions keywords (such as "project review"), match and filter in summary ; if not found, gradually expand the range up to the upper limit of 30 days before and after
  5. When displaying the schedule list, include key information such as title, time, location, and participants, so users can quickly understand

Create schedule

Classic query examples:

  • "Help me create a meeting from 2 PM to 3 PM tomorrow afternoon, titled Requirements Review"
  • "Arrange a full-day team-building activity on Friday"
  • "Create a schedule: have a product plan discussion with Zhang San and Li Si at 10 AM the day after tomorrow, location is the 3rd-floor meeting room"
  • "Help me create a schedule, next Monday 14:00-15:00, remind me 15 minutes in advance"
  • "Schedule an appointment for tomorrow morning, invite Wang Wei to attend"

Process:

  1. Parse the user's intent and extract information such as time, title, location, participants, and reminder settings
  2. If participants are involved, first use wecomcli-lookup-contact to query the userid; if there are people with the same name, display candidates for the user to choose
  3. If the user does not specify a reminder, set a reminder 15 minutes in advance by default (remind_before_event_secs: 900)
  4. If the user says "all day", set is_whole_day: 1, and set the time from 00:00:00 to 23:59:59 on that day
  5. After confirming the schedule information with the user (title, time, location, participants, etc.), call create_schedule

Modify schedule

Classic query examples:

  • "Move tomorrow's Requirements Review to 3 PM the day after tomorrow"
  • "Help me modify the title of this afternoon's meeting to Technical Plan Review"
  • "Change the location of my 14:00 schedule today to an online Tencent Meeting"
  • "Postpone Friday's team-building activity by one hour"
  • "Help me add a description to tomorrow's weekly meeting: discuss Q2 planning"

Process:

  1. First locate the target schedule through the query workflow (match based on keywords such as the time and title mentioned by the user)
  2. If multiple schedules are matched, display a candidate list for the user to confirm
  3. Confirm with the user the fields to be modified and the target values
  4. Call update_schedule, and pass in only the fields that need to be modified

Cancel schedule

Classic query examples:

  • "Cancel tomorrow afternoon's Requirements Review"
  • "Help me delete Friday's team-building schedule"
  • "I don't want to have the 15:00 meeting today anymore, help me cancel it"

Process:

  1. First locate the target schedule through the query workflow
  2. Confirm with the user the schedule information to be canceled (title, time, etc.) to avoid accidental operations
  3. After confirmation, call cancel_schedule

Manage participants

Classic query examples:

  • "Add Zhang San to tomorrow's Requirements Review meeting"
  • "Help me remove Li Si from Friday's schedule"
  • "Invite Wang Wei and Zhao Min again to tomorrow afternoon's meeting"
  • "Remove Liu Qiang from the participants of my technical sharing the day after tomorrow"

Process:

  1. Use wecomcli-lookup-contact to get the target person's userid; if there are people with the same name, display candidates for the user to choose
  2. Locate the target schedule through the query workflow
  3. Call add_schedule_attendees or del_schedule_attendees to complete adding/removing

Query availability and arrange a meeting

Classic query examples:

  • "Help me check whether Zhang San and Li Si are free tomorrow afternoon"
  • "Check my and Wang Wei's free time this week, I want to schedule a meeting"
  • "I want to have a meeting with Xiao Ming and Xiao Hong from the product team to see when everyone is available"
  • "Find a time slot tomorrow afternoon when everyone is available and schedule a 1-hour meeting"

Process:

  1. Via wecomcli-lookup-contact get the userids of the relevant people
  2. Call check_availability to query each user's busy time slots within the specified time range
  3. Analyze all users' busy time slots, calculate the common free time slots, and recommend them to the user
  4. After the user confirms the time slot, call create_schedule to create the meeting and automatically add the participants