Skip to main content
Glama
lm203688

feishu-mcp-server

by lm203688

list_calendars

Retrieve a list of Feishu calendars with an optional limit on results.

Instructions

获取飞书日历列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_sizeNo返回数量(默认20)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for 'list_calendars' - decorated with @mcp.tool(), calls client.list_calendars() and returns JSON.
    @mcp.tool()
    def list_calendars(page_size: int = 20) -> str:
        """获取飞书日历列表
    
        Args:
            page_size: 返回数量(默认20)
        """
        if not config.enable_calendar:
            return json.dumps({"error": "日历功能未启用"}, ensure_ascii=False)
        try:
            result = client.list_calendars(page_size)
            return json.dumps(result, ensure_ascii=False, indent=2, default=str)
        except Exception as e:
            return json.dumps({"error": str(e)}, ensure_ascii=False)
  • The FeishuClient method that makes the actual API request to /calendar/v4/calendars to list calendars.
    def list_calendars(self, page_size: int = 20) -> dict[str, Any]:
        """获取日历列表"""
        return self._request("GET", "/calendar/v4/calendars", params={"page_size": page_size})
  • The tool is registered via the @mcp.tool() decorator on the list_calendars function.
    @mcp.tool()
    def list_calendars(page_size: int = 20) -> str:
        """获取飞书日历列表
    
        Args:
            page_size: 返回数量(默认20)
        """
        if not config.enable_calendar:
            return json.dumps({"error": "日历功能未启用"}, ensure_ascii=False)
        try:
            result = client.list_calendars(page_size)
            return json.dumps(result, ensure_ascii=False, indent=2, default=str)
        except Exception as e:
            return json.dumps({"error": str(e)}, ensure_ascii=False)
  • Schema/input - accepts page_size: int = 20, returns str (JSON). Docstring defines the tool description and parameter.
    @mcp.tool()
    def list_calendars(page_size: int = 20) -> str:
        """获取飞书日历列表
    
        Args:
            page_size: 返回数量(默认20)
        """
        if not config.enable_calendar:
            return json.dumps({"error": "日历功能未启用"}, ensure_ascii=False)
        try:
            result = client.list_calendars(page_size)
            return json.dumps(result, ensure_ascii=False, indent=2, default=str)
        except Exception as e:
            return json.dumps({"error": str(e)}, ensure_ascii=False)
  • The _request helper method used by list_calendars to actually send the HTTP GET request to the Feishu API.
        self, method: str, path: str, *,
        params: Optional[dict] = None,
        json_data: Optional[dict] = None,
    ) -> dict[str, Any]:
        """发送API请求"""
        token = self._get_tenant_token()
        headers = {
            "Authorization": f"Bearer {token}",
            "Content-Type": "application/json",
        }
        resp = self._http.request(
            method,
            f"{self.config.base_url}{path}",
            headers=headers,
            params=params,
            json=json_data,
        )
        data = resp.json()
        if data.get("code") != 0:
            raise ValueError(f"API调用失败 [{data.get('code')}]: {data.get('msg', '未知错误')}")
        return data.get("data", {})
Behavior2/5

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

No annotations provided. Description only states 'get list' without behavioral details like authentication, rate limits, or data scope.

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

Conciseness4/5

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

Single sentence with no wasted words. However, could be slightly more informative without losing conciseness.

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

Completeness3/5

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

For a simple list operation with one optional parameter and an output schema, the description is minimally adequate. Lacks any detail about the output or usage context.

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 already documents the one parameter (page_size) at 100% coverage. Description adds no extra meaning beyond the schema.

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

Purpose5/5

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

The description '获取飞书日历列表' clearly states the action (获取/get) and resource (飞书日历列表/Feishu calendar list). It distinguishes from sibling tools like list_calendar_events and list_sheets.

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?

No guidance on when to use this tool vs alternatives. Does not mention prerequisites or exclusions.

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/lm203688/feishu-mcp-server'

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