Skip to main content
Glama

kintone_create_record

Creates a new record with field validation in a Kintone app. Requires app ID from kintone_list_apps.

Instructions

Create a new record in a Kintone app with field validation. ⚠️ Use 'kintone_list_apps' first to get available app IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYesThe ID of the Kintone app (use kintone_list_apps to see available app IDs)
record_dataYesRecord data as key-value pairs where keys are field codes and values are field values. Each field value should be an object with 'value' property.

Implementation Reference

  • The _handle_create_record function is the main handler for the kintone_create_record tool. It extracts app_id and record_data from arguments, validates them, calls client.create_record(), and returns a formatted success/error response.
    async def _handle_create_record(arguments: Dict[str, Any], client: KintoneClient) -> List[types.TextContent]:
        """Handle kintone_create_record tool call."""
        app_id = arguments.get("app_id")
        record_data = arguments.get("record_data")
    
        if not app_id or not record_data:
            return [types.TextContent(
                type="text",
                text="Error: Both app_id and record_data are required"
            )]
    
        if not isinstance(record_data, dict):
            return [types.TextContent(
                type="text",
                text="Error: record_data must be a dictionary"
            )]
    
        result = client.create_record(app_id=app_id, record_data=record_data)
    
        if result.get("success"):
            record_id = result.get("id")
            revision = result.get("revision")
    
            response_text = f"Successfully created record in app {app_id}\n"
            response_text += f"Record ID: {record_id}\n"
            response_text += f"Revision: {revision}\n\n"
            response_text += f"Created data:\n{json.dumps(record_data, indent=2, ensure_ascii=False)}"
    
            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 creating record in app {app_id}: {error_msg}"
            )]
  • The create_record method on KintoneClient sends a POST request to the Kintone 'record.json' endpoint with the app_id and record_data, and returns the id and revision on success.
    def create_record(self, app_id: str, record_data: Dict[str, Any]) -> Dict[str, Any]:
        """Create single record with field validation."""
        data = {
            'app': app_id,
            'record': record_data
        }
    
        result = self._make_request('POST', 'record.json', data=data)
    
        if result['success']:
            return {
                "success": True,
                "id": result['data'].get('id'),
                "revision": result['data'].get('revision')
            }
        return result
  • The get_crud_tools function defines the input schema for kintone_create_record (and other CRUD tools), specifying app_id (string) and record_data (object) as required parameters.
    def get_crud_tools() -> List[types.Tool]:
        """Get list of CRUD tools."""
        return [
            types.Tool(
                name="kintone_create_record",
                description="Create a new record in a Kintone app with field validation. ⚠️ 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)"
                        },
                        "record_data": {
                            "type": "object",
                            "description": "Record data as key-value pairs where keys are field codes and values are field values. Each field value should be an object with 'value' property."
                        }
                    },
                    "required": ["app_id", "record_data"]
                }
            ),
            types.Tool(
                name="kintone_update_record",
                description="Update an existing record in a Kintone app with revision control. ⚠️ 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)"
                        },
                        "record_id": {
                            "type": "string",
                            "description": "The ID of the record to update"
                        },
                        "record_data": {
                            "type": "object",
                            "description": "Record data to update as key-value pairs where keys are field codes and values are field values. Each field value should be an object with 'value' property."
                        },
                        "revision": {
                            "type": "integer",
                            "description": "Record revision number for optimistic locking (optional but recommended)"
                        }
                    },
                    "required": ["app_id", "record_id", "record_data"]
                }
            ),
            types.Tool(
                name="kintone_delete_record",
                description="Delete a record from a Kintone app by ID with safety confirmation. ⚠️ 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)"
                        },
                        "record_id": {
                            "type": "string",
                            "description": "The ID of the record to delete"
                        },
                        "revision": {
                            "type": "integer",
                            "description": "Record revision number for optimistic locking (optional but recommended)"
                        },
                        "confirm": {
                            "type": "boolean",
                            "description": "Confirmation flag to prevent accidental deletions (must be true)",
                            "default": False
                        }
                    },
                    "required": ["app_id", "record_id", "confirm"]
                }
            )
        ]
  • The handle_crud_tools function routes the tool name matching 'kintone_create_record' to the _handle_create_record handler.
    async def handle_crud_tools(name: str, arguments: Dict[str, Any], client: KintoneClient) -> List[types.TextContent]:
        """Handle CRUD tool calls."""
        try:
            if name == "kintone_create_record":
                return await _handle_create_record(arguments, client)
            elif name == "kintone_update_record":
                return await _handle_update_record(arguments, client)
            elif name == "kintone_delete_record":
                return await _handle_delete_record(arguments, client)
            else:
                return [types.TextContent(
                    type="text",
                    text=f"Error: Unknown CRUD tool '{name}'"
                )]
        except Exception as e:
            logger.error(f"Error in CRUD tool {name}: {e}")
            return [types.TextContent(
                type="text",
                text=f"Error executing {name}: {str(e)}"
            )]
  • The handle_call_tool function in server.py routes incoming tool calls; line 79 checks for 'kintone_create_record' and delegates to handle_crud_tools.
    @server.call_tool()
    async def handle_call_tool(name: str, arguments: Dict[str, Any]) -> List[types.TextContent]:
        """Handle tool calls by routing to appropriate tool modules."""
        client = get_client()
    
        # Query tools
        if name in ["kintone_get_records", "kintone_get_record"]:
            return await handle_query_tools(name, arguments, client)
    
        # CRUD tools
        elif name in ["kintone_create_record", "kintone_update_record", "kintone_delete_record"]:
            return await handle_crud_tools(name, arguments, client)
    
        # 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)
    
        else:
            logger.error(f"Unknown tool: {name}")
            return [types.TextContent(
                type="text",
                text=f"Error: Unknown tool '{name}'"
            )]
Behavior2/5

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

No annotations provided; description only mentions 'field validation' but does not disclose error handling, idempotency, return values, or authentication requirements.

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?

Two sentences, front-loaded with purpose and a critical warning, no superfluous text.

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

Completeness2/5

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

Despite low complexity, missing behavioral details and no output schema or annotations; leaves agent without information on return values, errors, or permissions.

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?

High schema coverage (100%) results in baseline 3; description reinforces app_id prerequisite but adds no new meaning beyond schema descriptions for parameters.

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?

Clearly states it creates a new record in a Kintone app with field validation, distinct from sibling tools like update or delete.

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

Usage Guidelines4/5

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

Explicitly advises using kintone_list_apps first to obtain app IDs, providing clear prerequisite context. Lacks when-not or alternative tool guidance.

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/luvl/mcp-kintone-lite'

If you have feedback or need assistance with the MCP directory API, please join our Discord server