wecom_mcpis an MCP tool; all operations are completed by calling this tool.
⚠️ Prerequisites: Before the first call to
wecom_mcp, you must follow thewecom-preflightskill to perform the prerequisite check and ensure the tool has been added to the whitelist.
Manage records (row data) in a smart sheet. All interfaces support locating documents by either docid or url .
CLI invocation method
Call via the wecom_mcp tool, with category doc:
Use the wecom_mcp tool to call wecom_mcp call doc <tool_name> '<json_params>' to invoke the specified skill
Return format description
All interfaces return a JSON object containing the following common fields:
| Field | Type | Description |
|---|---|---|
errcode |
integer | Return code,0 indicates success, non- 0 indicates failure |
errmsg |
string | Error message, "ok" |
when errcode is not 0 , it indicates the interface call failed and can be retried once; if it still fails, display errcode and errmsg to the user.
smartsheet_get_records
Query all records in a sub-sheet.
- Use the
wecom_mcptool to callwecom_mcp call doc smartsheet_get_records '{"docid": "DOCID", "sheet_id": "SHEETID"}' - or via URL: use the
wecom_mcptool to callwecom_mcp call doc smartsheet_get_records '{"url": "https://doc.weixin.qq.com/smartsheet/xxx", "sheet_id": "SHEETID"}'
See API details。
smartsheet_add_records
Add one or more rows of records; it is recommended to stay within 500 rows per call.
Before callingyou must first understand the field types of the target table (via smartsheet_get_fields)。
Use the wecom_mcp tool to call wecom_mcp call doc smartsheet_add_records '{"docid": "DOCID", "sheet_id": "SHEETID", "records": [{"values": {"任务名称": [{"type": "text", "text": "完成需求文档"}], "优先级": [{"text": "高"}]}}]}'
For the value format of each field type, see Cell value format reference。
smartsheet_update_records
Update one or more rows of records; a single call must stay within 500 rows. You need to provide record_id (obtained via smartsheet_get_records ).
Use the wecom_mcp tool to call wecom_mcp call doc smartsheet_update_records '{"docid": "DOCID", "sheet_id": "SHEETID", "records": [{"record_id": "RECORDID", "values": {"任务名称": [{"type": "text", "text": "更新后的内容"}]}}]}'
Note: The created time, last edited time, creator, and last editor fields cannot be updated.
smartsheet_delete_records
Delete one or more rows of records; a single call must stay within 500 rows.The operation is irreversible. record_id is obtained via smartsheet_get_records .
Use the wecom_mcp tool to call wecom_mcp call doc smartsheet_delete_records '{"docid": "DOCID", "sheet_id": "SHEETID", "record_ids": ["RECORDID1", "RECORDID2"]}'
Typical workflows
- Read data → Use the
wecom_mcptool to callwecom_mcp call doc smartsheet_get_records '{"docid":"DOCID","sheet_id":"SHEETID"}' - Write data → first
smartsheet_get_fieldslearn the column types → if a member (USER) field is involved, first usewecom-contact-lookup'sget_userlistfind the userid of the person →smartsheet_add_recordswrite - Update data → first
smartsheet_get_recordsobtain record_id → if a member (USER) field is involved, first usewecom-contact-lookup'sget_userlistfind the userid of the person →smartsheet_update_recordsupdate - Delete data → first
smartsheet_get_recordsconfirm record_id →smartsheet_delete_recordsdelete
Note: A member (USER) type field requires entering
user_idand cannot directly use a name. You must first use thewecom-contact-lookupskill'sget_userlistinterface to find the correspondinguseridby name before using it.