Skip to main content
Glama
lm203688

feishu-mcp-server

by lm203688

search_docs

Search Feishu documents using keywords to find relevant content. Configure the number of results returned.

Instructions

搜索飞书文档

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes搜索关键词
page_sizeNo返回结果数量(默认10)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'search_docs'. Decorated with @mcp.tool(), accepts query (str) and page_size (int, default 10), returns JSON string. Calls client.search_docs() and wraps result in JSON.
    @mcp.tool()
    def search_docs(query: str, page_size: int = 10) -> str:
        """搜索飞书文档
    
        Args:
            query: 搜索关键词
            page_size: 返回结果数量(默认10)
        """
        if not config.enable_doc:
            return json.dumps({"error": "文档功能未启用"}, ensure_ascii=False)
        try:
            result = client.search_docs(query, 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)
  • FeishuClient.search_docs() - the low-level API client method. Sends POST request to /search/v2/app with search_key, page_size, and app_filter (doc: true) to the Feishu/Lark Search API.
    def search_docs(self, query: str, page_size: int = 10) -> dict[str, Any]:
        """搜索文档"""
        return self._request(
            "POST", "/search/v2/app",
            json_data={
                "search_key": query,
                "page_size": page_size,
                "app_filter": {"doc": True},
            },
        )
  • Registration of search_docs as an MCP tool via the @mcp.tool() decorator on the search_docs function. FastMCP registers it automatically.
    @mcp.tool()
    def search_docs(query: str, page_size: int = 10) -> str:
  • Input schema for search_docs: 'query' (str, required) and 'page_size' (int, default 10). Return type is str (JSON-encoded).
    @mcp.tool()
    def search_docs(query: str, page_size: int = 10) -> str:
Behavior1/5

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

No annotations are provided, and the description adds no behavioral details beyond the basic function. It does not disclose side effects, authentication needs, rate limits, or pagination.

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?

The description is extremely concise, using a single phrase. While effective, it is perhaps too minimal for a non-trivial tool, but it avoids verbosity.

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?

Given the simple tool (2 parameters) and the presence of an output schema, the description is minimally sufficient but lacks guidance on usage context and return behavior.

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%, with both 'query' and 'page_size' adequately described. The description adds no extra meaning beyond the schema, so baseline score of 3 applies.

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 indicates the tool searches Feishu documents, and the name 'search_docs' aligns with that. It distinguishes from sibling tools like 'get_doc_content' which retrieves specific content.

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

Usage Guidelines1/5

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

No usage guidelines are provided. The description does not specify when to use this tool versus alternatives or any prerequisites.

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