Skip to main content
Glama

script_import_pine

Read-onlyIdempotent

Import a Pine v5 or v6 strategy or indicator as a cubicle.script, with the runner's own importer (cubicle-script import-pine). It answers the script (YAML, validated before it is handed out), the importer's notes (where Pine and the runner differ: fills, warm-up, na) and its header. A construct outside the subset is refused, never guessed: each diagnostic names its code (C057 a construct with no faithful translation: a while loop, a loop past 64 steps or over a range the bars decide, an array outside a capped var list of levels, maps, types, strings, the wall clock; bounded for loops, constant and display arrays and var level lists do translate, the last as 1.1 pools; C058 a second market, C059 not translated yet, C040 lookahead_on), the construct, the rule it breaks, its Pine line and what the code means. The translation goes on past a refusal, so every refused statement is listed at once. Say the refusal plainly and offer the rewrite the code suggests. At most 64 KB of Pine. Free.

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": {
      "pine": "<pine>"
    },
    "name": "script_import_pine"
  }
}

Input Schema

NameRequiredDescriptionDefault
tfNothe bar size (1s, 15s, 1m, 5m, 15m, 30m, 1h, 4h, 1d); the importer's default when left out
nameNothe script's name (lower case, digits, . _ -); imported when left out
pineYesthe Pine source text (//@version=5 or 6)
marketNothe market the script reads (NQ, ES, BTC, ETH, SOL); the importer's default when left out

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / market
      Added value: +{
      +  "description": "the market the script reads (NQ, ES, BTC, ETH, SOL); the importer's default when left out",
      +  "type": "string"
      +}
    • addedInput schema / properties / name
      Added value: +{
      +  "description": "the script's name (lower case, digits, . _ -); imported when left out",
      +  "type": "string"
      +}
    • changedInput schema / properties / pine / description
      Previous value: -"the Pine source"New value: +"the Pine source text (//@version=5 or 6)"
    • addedInput schema / properties / tf
      Added value: +{
      +  "description": "the bar size (1s, 15s, 1m, 5m, 15m, 30m, 1h, 4h, 1d); the importer's default when left out",
      +  "type": "string"
      +}
  2. Added

TDQS

A3.8/5.0
Behavior5/5

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

Well beyond the readOnly/idempotent annotations, the description discloses that the script is validated before being handed out, that the importer's notes flag Pine-vs-runner divergences (fills, warm-up, na), that translation continues past a refusal so all diagnostics arrive at once, and it names the diagnostic codes and their meaning. It also states hard limits: 64 KB of Pine and a 64-step loop cap, plus a cost signal ('Free').

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

Conciseness3/5

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

The purpose is front-loaded in the first clause, but the rest is a single dense run-on sentence with long parentheticals enumerating construct types and diagnostic codes. Much of that enumeration is genuinely useful, yet the phrasing ('It answers the script') and the nested lists make it harder to scan than it needs to be.

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?

With no output schema, the description carries the return contract and does so: YAML script, importer notes, header, and structured diagnostics with codes, rule, Pine line, and meaning. For a four-parameter import tool it covers what an agent needs to call it and interpret a partial or refused translation.

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

Parameters3/5

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

Schema description coverage is 100%, so tf, name, market and pine are already documented in structured data; the description only adds the 64 KB cap on the pine text. No additional syntax, defaulting behavior, or interaction between name and market is contributed beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 chain: import a Pine v5/v6 strategy or indicator as a cubicle.script via the runner's own importer. It is precise about what comes back (YAML, importer notes, header). It does not distinguish itself from nearby siblings such as script_validate or script_rehearse, so an agent must infer the routing.

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 context is implied by the import verb and the input requirements (Pine source with a //@version header, optional tf/name/market), and there is useful guidance on how to react to refusals ('Say the refusal plainly and offer the rewrite'). There is no explicit when-to-use versus when-to-use-another-tool statement, and no prerequisites are named beyond the 64 KB ceiling.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources