add_html_tool
Create a new HTML tool in the workspace resources/html directory and persist its data through connected sheets, databases, and settings instead of browser storage.
Instructions
Create a new HTML tool in the workspace resources/html directory. Call get_html_tool_guide first. A design-system baseline (tokens, dark mode, form/button styles) is auto-injected into HTML files at save — do not include CSS resets or base styles. Persist records in a Sheet: declare it in sheets (created in documents/Tools, or connect an existing sheet by name) and use await hillnote.sheet('Name') -> rows()/add()/update()/remove()/onChange(). Existing databases go in databases -> await hillnote.database('Name'). Mark the main source primary: true and read it with await hillnote.data() (add_tool_view then shows the tool as a Custom view tab of a database/sheet, where data() is that view's rows). Small state goes in hillnote.settings.get/set. Never use localStorage/sessionStorage/IndexedDB/cookies — they don't persist in the tool sandbox. The result includes a validation summary (if validation.issues is empty, do not read files back) and each sheet's column ids — key rows by column id.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workspacePath": "<workspacePath>",
"toolName": "<toolName>",
"files": "<files>"
},
"name": "add_html_tool"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | Files to create. Prefer a single self-contained index.html (all CSS/JS inline); sibling files (style.css, app.js, modules, extra pages) in the tool folder also load. | |
| glyph | No | Emoji glyph for the tool tile (e.g. "📊", "🎨") | |
| sheets | No | Sheets the tool stores its records in (max 20). With columns: creates a NEW sheet at documents/Tools/<name>, owned by this tool. Name only: connects an EXISTING sheet found by its name or folder name — the user approves access once. The tool code reaches each one with await hillnote.sheet(name). Everything is validated before anything is written. | |
| category | No | Optional category for organizing tools (e.g., "games", "utilities", "visualizations") | |
| toolName | Yes | Name of the HTML tool (will be used as folder name) | |
| databases | No | EXISTING databases (folders of row documents) the tool reads/writes (max 20), found by name or folder name — connect-only; tools never create databases. The user approves access once. The tool code reaches each one with await hillnote.database(name); row ids are the row documents' filenames and setting title renames the row. | |
| description | No | Brief description of what this HTML tool does | |
| workspacePath | Yes | Absolute path to the workspace directory |