Skip to main content
Glama
lm203688

feishu-mcp-server

by lm203688

get_doc_content

Retrieve the raw content of a Feishu document by providing its document ID. Useful for accessing document data programmatically.

Instructions

获取飞书文档的原始内容

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYes飞书文档ID(从URL中获取)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for 'get_doc_content' — decorated with @mcp.tool(), receives a document_id, checks if doc feature is enabled, calls client.get_doc_content(), and returns the result as JSON.
    @mcp.tool()
    def get_doc_content(document_id: str) -> str:
        """获取飞书文档的原始内容
    
        Args:
            document_id: 飞书文档ID(从URL中获取)
        """
        if not config.enable_doc:
            return json.dumps({"error": "文档功能未启用"}, ensure_ascii=False)
        try:
            result = client.get_doc_content(document_id)
            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 tool is registered via the @mcp.tool() decorator on the get_doc_content function, making it available in the FastMCP server's tool registry.
    @mcp.tool()
    def get_doc_content(document_id: str) -> str:
  • The client-side helper method that actually calls the Feishu API. It sends a GET request to /docx/v1/documents/{document_id}/raw_content using the internal _request method.
    def get_doc_content(self, document_id: str) -> dict[str, Any]:
        """获取文档内容"""
        return self._request("GET", f"/docx/v1/documents/{document_id}/raw_content")
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only states 'get original content' without detailing format, size limits, error handling, or permissions. The output schema exists but its info is not leveraged in the description.

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 a single, brief sentence with no redundant information. It is concise and front-loaded.

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

Completeness4/5

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

Given the tool's simplicity (one parameter) and the presence of an output schema, the description is nearly sufficient. However, it could mention the output type (e.g., raw text) to further help the agent.

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?

The sole parameter 'document_id' has a clear description in the schema ('from URL'), and the schema coverage is 100%. The description adds no extra semantic value beyond what the schema already provides.

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 tool retrieves the original content of a Feishu document. It specifies the verb 'get' and the resource 'original content', distinguishing it from sibling tools like get_doc_meta (metadata) and search_docs (search).

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

Usage Guidelines3/5

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

The description implies usage when raw document content is needed, but it does not explicitly state when to use this tool over alternatives, nor does it mention prerequisites or exclusions. Guidance is minimal.

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