search_bitable_records
Query records from Feishu Bitable tables with pagination and optional filtering to retrieve specific data entries.
Instructions
查询多维表格记录(支持分页)
参数:
app_token: 多维表格的token
table_id: 数据表ID
page_size: 每页记录数(1-500)
page_token: 分页token,首次查询为空
filter: (可选) 过滤条件
返回:
记录列表和分页信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_token | Yes | ||
| table_id | Yes | ||
| page_size | No | ||
| page_token | No | ||
| filter | No |
Implementation Reference
- The core handler function that implements the logic for the 'search_bitable_records' tool. It queries records from a Feishu Bitable table using the Lark API, supporting pagination and optional filters.@mcp.tool() @handle_feishu_error def search_bitable_records( app_token: str, table_id: str, page_size: int = 20, page_token: str = "", filter: dict = None, ) -> str: """ 查询多维表格记录(支持分页) 参数: app_token: 多维表格的token table_id: 数据表ID page_size: 每页记录数(1-500) page_token: 分页token,首次查询为空 filter: (可选) 过滤条件 返回: 记录列表和分页信息 """ client = get_client() request_builder = ( SearchAppTableRecordRequest.builder() .app_token(app_token) .table_id(table_id) .page_size(page_size) ) if page_token: request_builder.page_token(page_token) body_builder = SearchAppTableRecordRequestBody.builder() if filter: # TODO: 需要根据SDK文档正确构建filter pass request_builder.request_body(body_builder.build()) request = request_builder.build() response = client.bitable.v1.app_table_record.search(request) return lark.JSON.marshal(response.data, indent=4)
- src/yuppie_mcp_feishu/__init__.py:19-21 (registration)Registers all Bitable record tools, including 'search_bitable_records', by invoking the registration function during MCP server setup.# 注册多维表格工具 register_bitable_app_tools(mcp) register_bitable_record_tools(mcp)