kintone_get_form_fields
Retrieve field definitions, types, display names, and validation rules for a Kintone app using its app ID. Requires prior listing of apps to obtain the ID.
Instructions
⭐ ESSENTIAL: Get field definitions, types, display names, and validation rules for a Kintone app. ⚠️ Use 'kintone_list_apps' first to get available app IDs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | The ID of the Kintone app (use kintone_list_apps to see available app IDs) |
Implementation Reference
- The handler function _handle_get_form_fields that executes the kintone_get_form_fields tool logic. It extracts app_id from arguments, calls client.get_form_fields(), and formats the response with field code, label, type, and required status.
async def _handle_get_form_fields(arguments: Dict[str, Any], client: KintoneClient) -> List[types.TextContent]: """Handle kintone_get_form_fields tool call.""" app_id = arguments.get("app_id") if not app_id: return [types.TextContent( type="text", text="Error: app_id is required" )] result = client.get_form_fields(app_id=app_id) if result.get("success"): properties = result.get("properties", {}) response_text = f"Successfully retrieved form fields for app {app_id}\n\n" if properties: response_text += "Field Definitions:\n" for field_code, field_info in properties.items(): field_type = field_info.get("type", "N/A") label = field_info.get("label", "N/A") required = field_info.get("required", False) response_text += f"- {field_code}: {label} ({field_type})" if required: response_text += " [Required]" response_text += "\n" response_text += f"\nComplete Field Properties:\n{json.dumps(properties, indent=2, ensure_ascii=False)}" else: response_text += "No field definitions found." return [types.TextContent( type="text", text=response_text )] else: error_msg = result.get("error", "Unknown error occurred") return [types.TextContent( type="text", text=f"Error retrieving form fields for app {app_id}: {error_msg}" )] - The tool registration schema for kintone_get_form_fields, defining inputSchema with a required 'app_id' string parameter and a descriptive name/description.
types.Tool( name="kintone_get_form_fields", description="⭐ ESSENTIAL: Get field definitions, types, display names, and validation rules for a Kintone app. ⚠️ Use 'kintone_list_apps' first to get available app IDs.", inputSchema={ "type": "object", "properties": { "app_id": { "type": "string", "description": "The ID of the Kintone app (use kintone_list_apps to see available app IDs)" } }, "required": ["app_id"] } - src/mcp_kintone_lite/server.py:82-85 (registration)The routing in server.py where kintone_get_form_fields is matched in the metadata tools list and dispatched to handle_metadata_tools.
# Metadata tools elif name in ["kintone_list_apps", "kintone_get_app", "kintone_get_form_fields", "kintone_get_views", "kintone_get_form_layout"]: return await handle_metadata_tools(name, arguments, client) - The KintoneClient.get_form_fields() method that calls the Kintone REST API endpoint 'app/form/fields.json' with the app_id and returns field properties.
def get_form_fields(self, app_id: str) -> Dict[str, Any]: """Get field definitions, types, display names, validation rules.""" params = {'app': app_id} result = self._make_request('GET', 'app/form/fields.json', params=params) if result['success']: return { "success": True, "properties": result['data'].get('properties', {}) } return result