Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Productivity Tools

Five new Agent tools for managing Feishu contacts, chats, spreadsheets, calendar events, and tasks.


LarkContactTool

Look up Feishu users and departments.

use synaptic::lark::{LarkConfig, LarkContactTool};
use synaptic::core::Tool;
use serde_json::json;

let tool = LarkContactTool::new(config.clone());

// Get user by open_id
tool.call(json!({
    "action": "get_user",
    "user_id": "ou_xxx",
    "user_id_type": "open_id"
})).await?;

// Batch resolve emails to open_ids
tool.call(json!({
    "action": "batch_get_id",
    "emails": ["user@example.com"]
})).await?;

// List departments
tool.call(json!({ "action": "list_departments" })).await?;

Actions

ActionRequired fieldsDescription
get_useruser_idGet a user by ID (default type: open_id)
batch_get_idemails or mobilesResolve emails/mobiles to open_ids
list_departmentsList departments (optional parent_department_id)
get_departmentdepartment_idGet a department by ID

LarkChatTool

Manage group chats — list, create, update membership.

use synaptic::lark::{LarkChatTool, LarkConfig};
use synaptic::core::Tool;
use serde_json::json;

let tool = LarkChatTool::new(config.clone());

// List all chats the bot is in
tool.call(json!({ "action": "list" })).await?;

// Create a group with members
tool.call(json!({
    "action": "create",
    "name": "Project Alpha",
    "member_open_ids": ["ou_xxx"]
})).await?;

// Add members to existing group
tool.call(json!({
    "action": "add_members",
    "chat_id": "oc_xxx",
    "member_open_ids": ["ou_yyy"]
})).await?;

Actions

ActionRequired fieldsDescription
listList all chats the bot belongs to
getchat_idGet details of a specific chat
createnameCreate a group chat (optional: description, member_open_ids)
updatechat_idUpdate name or description
list_memberschat_idList members of a chat
add_memberschat_id, member_open_idsAdd members
remove_memberschat_id, member_open_idsRemove members

LarkSpreadsheetTool

Read and write Feishu Spreadsheet ranges.

use synaptic::lark::{LarkConfig, LarkSpreadsheetTool};
use synaptic::core::Tool;
use serde_json::json;

let tool = LarkSpreadsheetTool::new(config.clone());

// Write data to a range
tool.call(json!({
    "action": "write",
    "spreadsheet_token": "shtcnXxx",
    "range": "Sheet1!A1:B2",
    "values": [["Name", "Score"], ["Alice", 95]]
})).await?;

// Append rows
tool.call(json!({
    "action": "append",
    "spreadsheet_token": "shtcnXxx",
    "range": "Sheet1!A:B",
    "values": [["Bob", 88]]
})).await?;

// Read a range
tool.call(json!({
    "action": "read",
    "spreadsheet_token": "shtcnXxx",
    "range": "Sheet1!A1:B3"
})).await?;

Range format: "SheetName!A1:B3" (same notation as Google Sheets).

Actions

ActionRequired fieldsDescription
writespreadsheet_token, range, valuesOverwrite a range with 2D array
appendspreadsheet_token, range, valuesAppend rows after last row
clearspreadsheet_token, rangeClear all values in a range
readspreadsheet_token, rangeRead values; returns { values: [[...], ...] }

LarkCalendarTool

Manage calendar events — create, list, update, delete.

use synaptic::lark::{LarkCalendarTool, LarkConfig};
use synaptic::core::Tool;
use serde_json::json;

let tool = LarkCalendarTool::new(config.clone());

// Create an event
tool.call(json!({
    "action": "create_event",
    "calendar_id": "primary",
    "summary": "Team Sync",
    "start_time": "1735689600",
    "end_time": "1735693200",
    "description": "Weekly sync"
})).await?;

// List upcoming events
tool.call(json!({
    "action": "list_events",
    "calendar_id": "primary",
    "start_time": "1735689600"
})).await?;

Times are Unix timestamp strings (seconds since epoch).

Actions

ActionRequired fieldsDescription
list_calendarsList accessible calendars
list_eventscalendar_idList events (optional start_time, end_time filter)
get_eventcalendar_id, event_idGet event details
create_eventcalendar_id, summary, start_time, end_timeCreate an event
update_eventcalendar_id, event_idUpdate event fields (optional: summary, description, start_time, end_time)
delete_eventcalendar_id, event_idDelete an event

LarkTaskTool

Create and manage Feishu Tasks.

use synaptic::lark::{LarkConfig, LarkTaskTool};
use synaptic::core::Tool;
use serde_json::json;

let tool = LarkTaskTool::new(config.clone());

// Create a task
tool.call(json!({
    "action": "create",
    "summary": "Review PR #42",
    "due_timestamp": "1735689600"
})).await?;

// Complete a task
tool.call(json!({
    "action": "complete",
    "task_guid": "task_xxx"
})).await?;

// List tasks
tool.call(json!({ "action": "list" })).await?;

Actions

ActionRequired fieldsDescription
listList tasks (paginated, optional page_token)
gettask_guidGet task details
createsummaryCreate a task (optional: due_timestamp, description)
updatetask_guidUpdate task fields (optional: summary, description, due_timestamp)
completetask_guidMark a task as complete
deletetask_guidDelete a task