Tutorial: Attach Skills and MCP Tools to an Agent
Using a “Meeting Assistant” Agent as the example, this tutorial shows how a LanSphere Agent attaches Lansenger MCP tools and a custom skill: the user states needs in natural language, and the Agent autonomously decides to call tools — querying the calendar, creating meetings, sending private messages — to get things done. It is for developers who already know Workflows and Chatflows and want to build autonomous task execution.
Scenario and Value
Checking calendars before booking a meeting, notifying attendees one by one after creating it, organizing minutes afterward — none of this is hard, but it is tedious. The difference between an Agent and a Workflow: a Workflow executes a fixed flow; an Agent has the LLM plan from user intent and call tools. Attach Lansenger’s calendar, meeting, and messaging capabilities to the Agent as MCP tools, plus a custom “Meeting Minutes” skill — and the user gets a chain of operations done in one sentence.
What You Will Build
A “Meeting Assistant” Agent: it checks the user’s calendar, creates meetings, sends Lansenger notifications to attendees, and organizes meeting records into structured minutes. Finally publish it as a Lansenger AI Assistant — end users chat with it directly in the Lansenger client’s “AI Assistant Marketplace.”
Preparation
| Item | Requirement |
|---|---|
| Platform role | Developer or above (the “Agent,” “MCP Services,” and “SKILL Management” entries are visible only to Developer and above); publishing as a Lansenger AI Assistant requires Admin or above |
| Lansenger MCP Service | The Lansenger MCP Service added under “left menu → MCP Services,” with calendar, video-meeting, and messaging tools available |
| Custom skill | Create the “Meeting Minutes” Code Skill per Step 1 of this article |
| Lansenger binding | Make sure the account is linked to Lansenger before publishing (“Account → Link Lansenger”) |
Step 1: Create the “Meeting Minutes” Code Skill
A skill is a reusable capability unit; once attached to an Agent, the LLM decides when to call it based on user intent. Here we create a Code Skill that organizes a pasted meeting record into a structured result of “conclusion summary + action items.”
- Go to “left menu → SKILL Management → Custom Skills” and click “Create Skill.”
- Basic info: Name it “Meeting Minutes” (required, up to 30 characters, unique within the workspace); description optional (up to 200 characters).
- Choose a type: Code Skill (a Python snippet with input/output schemas defined).
Note: The skill type cannot be changed after creation.
- Configure input parameters (JSON Schema), for example:
{
"type": "object",
"properties": {
"meeting_title": { "type": "string", "description": "Meeting title" },
"transcript": { "type": "string", "description": "Raw meeting discussion or notes of key points" }
},
"required": ["transcript"]
}
- Configure output parameters (JSON Schema), for example:
{
"type": "object",
"properties": {
"summary": { "type": "string", "description": "Meeting conclusion summary" },
"action_items": {
"type": "array",
"items": { "type": "string" },
"description": "Action item list"
}
}
}
- Configure execution logic: Write a Python snippet that parses the input and returns a structure matching the output schema, for example:
def main(meeting_title: str = "", transcript: str = "") -> dict:
lines = [line.strip() for line in transcript.splitlines() if line.strip()]
action_items = [line for line in lines if "待办" in line or "负责" in line]
summary = lines[0] if lines else "无有效会议记录"
if meeting_title:
summary = f"{meeting_title}:{summary}"
return {"summary": summary, "action_items": action_items}
Tip: Follow the code template provided on the page, and make sure the returned fields match the output schema.
- Debug and save: At least one successful debug is required before saving (30-second debug timeout) — verify the output structure with a real meeting record, then save.
Step 2: Create the Agent
- Click “New Project,” pick the app type “Agent,” and fill in the name (e.g., “Meeting Assistant”).
- On the “App Development” tab, finish model selection (the system default chat model works).
- Write the prompt. The prompt governs the Agent’s responses — internal only, invisible to end users:
You are a meeting assistant, helping users with calendar, meeting, and meeting-notification matters.
## Scope of capabilities
1. Query calendar: Query the schedule for the date the user specifies.
2. Create meeting: Create a meeting from the subject, time, and attendees the user provides.
3. Send notification: Send Lansenger private messages to designated attendees.
4. Organize minutes: Generate structured meeting minutes from a meeting record the user pastes.
## Execution rules
- Before real actions like creating a meeting or sending a notification, restate the key info to the user
(subject, time, attendees, message content) and execute only after confirmation.
- When info is insufficient, ask proactively — never guess dates, times, or people.
- When the user says relative dates like "today" or "tomorrow," convert them to concrete dates before calling tools.
- When a tool call fails, tell the user it failed and suggest retrying — never pretend it is done.
## Output format
- Show calendars and meeting lists in bullet points, including time and subject.
- After completing an action, give a brief receipt: what was done, what the key info is.
- For requests unrelated to meetings or calendars, politely explain your capability boundary.
Step 3: Attach Lansenger MCP Tools
In “App Development → Tool Configuration,” check the following tools of the Lansenger MCP Service under the MCP Services category:
| Tool | Category | Purpose |
|---|---|---|
| Query events | Calendar | Query the schedule by date |
| Create meeting | Video Meetings | Create a meeting |
| Send private message | Messaging | Send a Lansenger notification to a designated attendee |
Once attached, the LLM decides which tool to call and when based on user intent — no fixed order to orchestrate on a canvas.
Step 4: Attach the “Meeting Minutes” Skill
In the “Skills” category of the Tool Configuration area, check the “Meeting Minutes” skill created in Step 1. If the Agent has multiple skills attached, allow or forbid specific skills as needed to keep skills with similar intents from interfering with each other.
Step 5: Form Configuration (Optional)
To have users fill in basic info before entering the conversation (e.g., default attendee scope, department), add form items in Form Configuration. Form variables automatically replace the corresponding variables in the prompt, reducing repetition every turn. Configure as prompted on the page.
Step 6: Debug the Conversation
Run three turns in the debug area and watch how the model decides to call tools:
Turn 1: Check the calendar. User: “What is on my schedule today?” — the model recognizes a query intent, calls the “Query events” tool, and returns the results in bullet points.
Turn 2: Create a meeting. User: “Book a project review meeting at 3 PM tomorrow, attendees Zhang San and Li Si.” — the model first converts “tomorrow” to a concrete date, restates the subject, time, and attendees for confirmation; after the user replies “confirmed,” it calls the “Create meeting” tool and reports the result.
Turn 3: Send notifications. User: “Send Zhang San and Li Si a message reminding them to bring quarterly data to tomorrow’s review.” — the model calls the “Send private message” tool one by one, then reports how the sending went.
The three turns cover the typical decision path of “query → execute after confirmation → batch operation.” While debugging, focus on: did the model pick the right tool, were relative dates converted correctly, and did it ask for confirmation before sensitive operations?
Step 7: Publish as a Lansenger AI Assistant
Agents support publishing as a Lansenger AI Assistant (Admin role or above required, and only for apps you created yourself):
- Go to the app details page → “Publishing Channels” tab and pick “Lansenger AI Assistant.”
- An account linked to Lansenger confirms in the pop-up and publishes directly; an unlinked one follows the pop-up to the Lansenger authorization center — publishing runs automatically once QR-code authentication passes.
- The assistant title defaults to the app name (within 10 characters) and the description defaults to the app description (within 20 characters).
- After publishing, the system automatically creates the app and bot instance on the Lansenger side and lists it in the Lansenger client’s “AI Assistant Marketplace.” End users must complete data authorization on first use — chatting starts only after approval.
Tuning and Boundaries
| Symptom | Fix |
|---|---|
| Model “pretends success” after a tool call fails | Strengthen the failure-handling rules in the prompt; configure error-time responses in “Error Handling” as prompted on the page |
| Sensitive operations executed without confirmation | Spell out “restate first, confirm, then execute” in the prompt, listing creating meetings and sending notifications as operations needing secondary confirmation |
| Model picks the wrong tool | Narrow the attached scope to only the necessary tools; write each tool’s trigger conditions clearly in the prompt’s capability scope |
| Wrong relative-date conversion | Require converting to concrete dates first in the prompt, and confirm with the user before executing |
After going live, check metrics like success rate and tool-call distribution in the “Data Dashboard” tab, and mark answers Like/Dislike with annotated replies in the “Conversation Logs” tab to keep improving.
Ideas for Extension
- Associate a Knowledge Base: Attach files like meeting-minutes templates and meeting-room usage rules to the Agent for answers closer to your organization’s reality;
- Called from a Workflow: Make “weekly meeting reminder” a scheduled Workflow and call this Agent via an “Agent” node on the canvas;
- Batch notifications: Use the Lansenger MCP “Get group members” tool to send notifications group-wide in batch;
- Workflow Skill: When a proven Workflow already exists, package it as a Workflow Skill and attach it to the Agent, reusing the existing flow.

