Create New Table
openl_create_project_tableCreate decision tables, spreadsheets, datatypes, and other table types in an OpenL project. Specify the module, table structure, and type-specific fields like rules or rows.
Instructions
Create a new table/rule in an OpenL project (Create New Project Table API). This is the recommended tool for creating new OpenL tables programmatically. Use cases: Create Rules (decision tables), Spreadsheet tables, Datatype definitions, Test tables, or other table types. Requires moduleName (an EXISTING project module — modules correspond to the project's .xlsx files; a freshly created blank project has a single module named 'Main') and a complete table structure (EditableTableView). The table structure must include 'tableType' and 'name'. CRITICAL: 'tableType' is a CASE-SENSITIVE discriminator — use EXACTLY one of: Datatype, Vocabulary, Spreadsheet, SimpleSpreadsheet, SimpleRules, SmartRules, SimpleLookup, SmartLookup, Data, Test, RawSource (a lowercase value like 'datatype' is rejected by the backend). Add type-specific data: fields (Datatype), rules (SimpleRules/SmartRules), rows (Spreadsheet), steps (SimpleSpreadsheet), values (Vocabulary). For RULES/DECISION tables (SimpleRules/SmartRules) and lookups you MUST also provide: 'returnType' (e.g. "String"), 'args': [{name,type}] (the input parameters), and 'headers': [{title}] (the column captions — one per rule-row key, the return column is usually titled "RET1"); each 'rules' row is a map keyed by those header titles. There is NO 'signature' field — the method is defined by name + returnType + args. Example SimpleRules: {tableType:"SimpleRules", name:"CreditCategory", returnType:"String", args:[{name:"creditScore",type:"Integer"}], headers:[{title:"creditScore"},{title:"RET1"}], rules:[{creditScore:"< 580", RET1:"Poor"}, {creditScore:">= 800", RET1:"Excellent"}]}. WARNING: the backend rejects unknown/extra fields with an opaque 400 "Failed to read request". 'id' is optional. Use get_table() on an existing table as a reference for the structure (for a blank project with no tables, use the tableType list and the SimpleRules example above). The response contains the created table's metadata (id, signature), NOT a compilation result — call openl_project_status afterward to confirm the project still compiles. This tool uses the Create New Project Table API endpoint.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Complete table structure (EditableTableView), selected by the CASE-SENSITIVE 'tableType' discriminator (Datatype, Vocabulary, Spreadsheet, SimpleSpreadsheet, SimpleRules, SmartRules, SimpleLookup, SmartLookup, Data, Test, RawSource — lowercase like 'datatype' is rejected). Each table type has a DIFFERENT shape (shown per branch); the backend rejects unknown/extra fields with a 400 'Failed to read request'. Rules tables use args/returnType/headers[{title}]/rules; Data and Test tables use headers[{fieldName}]/rows[{values}] (Test also needs testedTableName) — do NOT mix the two. There is NO 'signature' field. Tip: openl_get_table() on an existing table of the SAME type returns this exact shape to copy. | |
| projectId | Yes | Project ID returned by backend. Use the exact 'projectId' value from openl_list_projects() response without modification or reformatting. | |
| sheetName | No | Name of the sheet where the table will be created within the Excel file. If not provided, the table name will be used as the sheet name. | |
| moduleName | Yes | Name of an existing project module where the table will be created (for example, 'Main' or 'Rules'). | |
| response_format | No | Response format: 'json' for structured data, 'markdown' for human-readable (default), 'markdown_concise' for brief summary (1-2 paragraphs), 'markdown_detailed' for full details with context | markdown |