create_bitable_record
Add a single record to a Feishu multidimensional table by specifying table ID and field values. This tool enables data entry into structured Bitable databases.
Instructions
在多维表格中创建单条记录
参数:
app_token: 多维表格的token
table_id: 数据表ID
fields: 记录字段字典,例如 {"text_field": "值", "number_field": 123}
返回:
创建的记录信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_token | Yes | ||
| table_id | Yes | ||
| fields | Yes |
Implementation Reference
- Core implementation of the 'create_bitable_record' tool handler. Creates a single record in a Feishu Bitable (multi-dimensional table) using the Lark_oapi client. Includes type hints serving as input schema and docstring documentation.@mcp.tool() @handle_feishu_error def create_bitable_record(app_token: str, table_id: str, fields: dict) -> str: """ 在多维表格中创建单条记录 参数: app_token: 多维表格的token table_id: 数据表ID fields: 记录字段字典,例如 {"text_field": "值", "number_field": 123} 返回: 创建的记录信息 """ client = get_client() request = ( CreateAppTableRecordRequest.builder() .app_token(app_token) .table_id(table_id) .request_body(lark.AppTableRecord.builder().fields(fields).build()) .build() ) response = client.bitable.v1.app_table_record.create(request) return lark.JSON.marshal(response.data, indent=4)
- src/yuppie_mcp_feishu/__init__.py:20-21 (registration)Top-level registration of the bitable_record_tools, which registers the 'create_bitable_record' tool among others, in the MCP server initialization.register_bitable_app_tools(mcp) register_bitable_record_tools(mcp)
- src/yuppie_mcp_feishu/tools/bitable_record.py:21-21 (registration)The registration function that defines and registers the 'create_bitable_record' tool using @mcp.tool() decorator.def register_bitable_record_tools(mcp: FastMCP):