convert_to_json
Convert DOMQL JavaScript source code into platform JSON format by parsing export statements and stringifying functions, enabling direct use with save_to_project.
Instructions
Convert DOMQL JavaScript source code to platform JSON format.
Parses export statements from generated component/page code and converts them into the structured JSON the Symbols platform expects. Functions are automatically stringified (as the platform stores them as strings).
Use this after generate_component or generate_page to get JSON that can be passed directly to save_to_project.
Mirrors the @symbo.ls/frank toJSON + stringifyFunctions pipeline that the
CLI uses when running smbls push.
Args: source_code: JavaScript source code with export const/default statements. section: Target section — "components", "pages", "functions", "snippets", "designSystem", "state". Determines how exports are categorized.
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": {
"source_code": "<source_code>"
},
"name": "convert_to_json"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| section | No | components | |
| source_code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |