contact-lookup
Feishu Contacts queries: look up users, list department members, query organizational structure.
Invocation
Invoke via the channel tool's action parameter:
| Action |
Description |
get_user |
Query user information |
list_users |
List users under a department |
get_department |
Query department information |
list_departments |
List sub-departments |
Parameters
get_user
| Parameter |
Type |
Required |
Description |
| user_id |
string |
No |
User open_id.When omitted, the current sender's open_id is used automatically. No need to provide it when querying "who am I". Only specify it when querying other people. |
| user_id_type |
string |
No |
ID type (open_id/union_id/user_id, default open_id) |
list_users
| Parameter |
Type |
Required |
Description |
| department_id |
string |
Yes |
Department ID |
| user_id_type |
string |
No |
User ID type to return |
| page_size |
integer |
No |
Number per page (default 50) |
| page_token |
string |
No |
Pagination token |
get_department
| Parameter |
Type |
Required |
Description |
| department_id |
string |
Yes |
Department ID |
list_departments
| Parameter |
Type |
Required |
Description |
| parent_department_id |
string |
No |
Parent department ID (defaults to root department) |
| page_size |
integer |
No |
Number per page (default 50) |
| page_token |
string |
No |
Pagination token |
Examples
查看我的信息(自动使用当前用户)
-> channel(action="get_user")
查找其他用户信息(需指定 user_id)
-> channel(action="get_user", user_id="ou_xxx")
列出工程部成员
-> channel(action="list_users", department_id="dept_xxx")
查看部门信息
-> channel(action="get_department", department_id="dept_xxx")
列出所有顶级部门
-> channel(action="list_departments")
Auto-execution principles
- user_id auto-resolution: When omitted, it is automatically obtained from the current sender's open_id; do not ask the user.
- user_id_type auto-default: Uses
open_idby default; do not ask the user which ID type to use.
- Zero-parameter invocation: When the user says "who am I"/"view my information", call
channel(action="get_user")directly; no parameters are needed.
- Department browsing auto-execution: When the user says "look at departments", call
channel(action="list_departments") directly to list the root department; do not ask for the parent department ID.
- No interactive menus: Do not present [1] [2] [3] options for the user to select an identity type; directly use the most reasonable default value.
- Chained auto-execution: After retrieving user information, if it contains a department ID, you may automatically query department details to enrich the result.
Security level
- All operations: L1 read-only, no approval required