Skip to main content
Glama

Convert TradingView widget options

convert_widget_options
Read-onlyIdempotent

Turns the options object of TradingView's widget (new TradingView.widget({...}): its options, disabled_features / enabled_features and overrides) into ChartWidget options, or Lightweight Charts' createChart options into Chart options.

Instructions

Turns the options object of TradingView's widget (new TradingView.widget({...}): its options, disabled_features / enabled_features and overrides) into ChartWidget options, or Lightweight Charts' createChart options into Chart options. Returns the options, the calls to make once the chart exists, what has no place (each with what to do), and what validate_options finds in the result. Write functions and other code as strings; they are carried as they are.

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": {
      "options": "<options>"
    },
    "name": "convert_widget_options"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceNoThe library the app uses now: 'tradingview' (Advanced Charts, Trading Platform; the default) or 'lightweight-charts'.
optionsYesThe old options object, as JSON.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.13.0

TDQS

A4.1/5.0
Behavior4/5

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

Because annotations already establish that this is a read-only, idempotent, non-destructive operation, the description adds substantial value by describing the return contract: converted options, post-creation calls, unsupported options with handling guidance, and validation findings. It also discloses the important constraint that functions and code must be provided as strings and are carried as-is. Error behavior or partial-conversion semantics are not described.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loads the conversion action, followed by the return contract and the code-as-string rule. The first sentence is long and dense, but every part contributes information needed to invoke and interpret the tool.

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?

For a moderately complex conversion tool with no output schema, the description covers the essential input shape, output components, unsupported-option behavior, and validation findings. It is nearly complete, though it could be stronger with explicit prerequisites or error handling guidance.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds useful meaning by naming the TradingView option subfields (options, disabled_features, enabled_features, overrides) and by clarifying that code must be written as strings. It does not add details for the source parameter beyond what the schema already provides.

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 states a specific verb and resource: converting TradingView widget options into ChartWidget options, or Lightweight Charts createChart options into Chart options. This clearly separates it from siblings such as validate_options, migration_lookup, and migration_plan.

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

Usage Guidelines3/5

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

Usage is implied by the conversion context, but the description does not explicitly say when to choose this tool over validate_options, migration_plan, or other siblings. It does mention that the result includes what validate_options finds, which hints at a follow-up step, but no explicit when-to-use or when-not-to-use guidance is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.