Skip to main content
Glama

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sectionNocomponents
source_codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It reveals a key non-obvious behavior: 'Functions are automatically stringified (as the platform stores them as strings).' It also mentions that the tool mirrors the @symbo.ls/frank toJSON + stringifyFunctions pipeline, which sets accurate expectations for the output shape. It does not cover error cases, but overall it adds significant transparency beyond the basic purpose.

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?

The description is well-structured and front-loaded with the core purpose. Each paragraph adds value: usage guidance, pipeline mirroring, and parameter explanations. It is concise without being terse, and no sentence is wasted. The Args format is clean and organized.

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

Completeness4/5

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

Given that an output schema exists, the description does not need to detail return values. It covers purpose, usage timing, a key behavioral transformation, and parameter semantics. It is complete enough for an AI to select and invoke the tool correctly, though it could mention potential limitations or prerequisites (e.g., that exports must be present) for full completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, but the description compensates with an 'Args' section. It explains source_code as 'JavaScript source code with export const/default statements' and section as 'Target section — "components", "pages", "functions", "snippets", "designSystem", "state"' including how it determines categorization. This adds meaning beyond the raw schema, though the source_code description could be more detailed.

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?

The description opens with a specific verb+resource: 'Convert DOMQL JavaScript source code to platform JSON format.' It clearly distinguishes from sibling tools like convert_react and convert_html, and further explains it parses export statements and stringifies functions, making the tool's purpose unambiguous.

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?

The description explicitly states when to use the tool: 'Use this after generate_component or generate_page to get JSON that can be passed directly to save_to_project.' It gives clear context for the intended pipeline position, though it does not explicitly mention when not to use it or name alternatives (those are implied by sibling tools).

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/symbo-ls/symbols-mcp'

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