get_doc_meta
Retrieve Feishu document metadata such as title and owner by providing the document ID.
Instructions
获取飞书文档的元信息(标题、所有者等)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | 飞书文档ID |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/feishu_mcp_server/server.py:54-67 (handler)MCP tool handler for get_doc_meta - fetches document metadata (title, owner, etc.) from Feishu via the client layer. Decorated with @mcp.tool() to register as an MCP tool.
@mcp.tool() def get_doc_meta(document_id: str) -> str: """获取飞书文档的元信息(标题、所有者等) Args: document_id: 飞书文档ID """ if not config.enable_doc: return json.dumps({"error": "文档功能未启用"}, ensure_ascii=False) try: result = client.get_doc_meta(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) - Client helper that makes the actual HTTP GET request to the Feishu API endpoint /docx/v1/documents/{document_id} to retrieve document metadata.
def get_doc_meta(self, document_id: str) -> dict[str, Any]: """获取文档元信息""" return self._request("GET", f"/docx/v1/documents/{document_id}") - src/feishu_mcp_server/server.py:54-55 (registration)Registration via @mcp.tool() decorator on the FastMCP instance, which registers the function as an MCP tool named 'get_doc_meta'.
@mcp.tool() def get_doc_meta(document_id: str) -> str: