Skip to main content
Glama
al-one

MCP Server for notify to weixin / telegram / bark / lark

飞书/Lark机器人-发送文本消息

lark_send_text

Send text or Markdown messages to Lark group chats using bot integration. Configure bot keys and message types to deliver notifications through the MCP notification server.

Instructions

飞书/Lark群机器人发送文本或Markdown消息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes消息内容
msgtypeNo内容类型,仅支持: text/markdownmarkdown
bot_keyNo飞书/Lark机器人key,uuid格式,默认从环境变量获取
is_larkNo根据用户描述识别 0:飞书 1:Lark

Implementation Reference

  • Handler function for the lark_send_text tool. Includes input parameter definitions (schema), API documentation, and core logic to send text or markdown messages to Feishu or Lark group bots via webhook POST request.
    def lark_send_text(
        text: str = Field(description="消息内容"),
        msgtype: str = Field("markdown", description="内容类型,仅支持: text/markdown"),
        bot_key: str = Field("", description="飞书/Lark机器人key,uuid格式,默认从环境变量获取"),
        is_lark: int = Field(0, description="根据用户描述识别 0:飞书 1:Lark"),
    ):
        """
        https://open.feishu.cn/document/ukTMukTMukTM/ucTM5YjL3ETO24yNxkjN
        https://open.larksuite.com/document/client-docs/bot-v3/add-custom-bot
        """
        if msgtype == "markdown":
            body = {
                "msg_type": "interactive",
                "card": {"elements": [{"tag": msgtype, "content": text}]},
            }
        else:
            body = {"msg_type": msgtype, "content": {"text": text}}
        if not bot_key:
            bot_key = os.getenv("LARK_BOT_KEY" if is_lark else "FEISHU_BOT_KEY", "")
        if is_lark:
            base = os.getenv("LARK_BASE_URL") or "https://open.larksuite.com"
        else:
            base = os.getenv("FEISHU_BASE_URL") or "https://open.feishu.cn"
        res = requests.post(
            f"{base}/open-apis/bot/v2/hook/{bot_key}",
            json=body,
        )
        return res.json()
  • Input schema defined using Pydantic Field for validation and descriptions: text (message content), msgtype (text/markdown), bot_key (webhook key from env), is_lark (0 for Feishu, 1 for Lark).
    text: str = Field(description="消息内容"),
    msgtype: str = Field("markdown", description="内容类型,仅支持: text/markdown"),
    bot_key: str = Field("", description="飞书/Lark机器人key,uuid格式,默认从环境变量获取"),
    is_lark: int = Field(0, description="根据用户描述识别 0:飞书 1:Lark"),
  • Registers the lark_send_text tool to the MCP server using @mcp.tool decorator with Chinese title and description.
        title="飞书/Lark机器人-发送文本消息",
        description="飞书/Lark群机器人发送文本或Markdown消息",
    )
  • Invokes add_tools from other.py on the FastMCP instance, executing the @mcp.tool registrations including lark_send_text.
    other.add_tools(mcp)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('发送' - send) which implies a write operation, but doesn't cover permissions, rate limits, error handling, or what happens on success/failure. For a messaging tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence that gets straight to the point with no wasted words. It's front-loaded with the essential information (what the tool does) and doesn't include any unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a messaging tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after sending (success indicators, error responses, message IDs), doesn't mention authentication requirements (though bot_key is in schema), and provides no context about the messaging platform's limitations or behavior. The single sentence is insufficient for proper agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional parameter information beyond what's in the schema - it mentions '文本或Markdown消息' which aligns with the 'msgtype' parameter but provides no extra context. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('发送文本或Markdown消息') and target resource ('飞书/Lark群机器人'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'wework_send_text' or 'ding_send_text' beyond mentioning the specific platform (Lark/Feishu), which is helpful but not a full distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, context for choosing Lark over other messaging platforms like WeWork or DingTalk, or specific scenarios where this tool is appropriate. Usage is implied by the platform name only.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/al-one/mcp-notify'

If you have feedback or need assistance with the MCP directory API, please join our Discord server