Skip to main content
Glama

pine_analyze

Analyze Pine Script offline to detect array out-of-bounds, unguarded array.get, invalid loops, lookahead bias, and deprecated syntax before compiling—no live TradingView needed.

Instructions

Run offline static analysis on Pine Script source code: detects array out-of-bounds, unguarded array.get/first/last, invalid loop ranges, lookahead bias, and deprecated syntax. WHEN TO USE: Call before compiling code to verify correctness without needing a live TradingView connection. SIDE EFFECTS: None (Read-only offline parser). LIMITATIONS: Static AST parsing only; does not execute runtime logic.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesPine Script source code to analyze

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: 'SIDE EFFECTS: None (Read-only offline parser)' declares safety, and 'LIMITATIONS: Static AST parsing only; does not execute runtime logic' discloses the analysis boundary. It omits what the result looks like, but the safety and scope profile is solidly covered.

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?

Front-loads the core action, then uses labeled WHEN TO USE / SIDE EFFECTS / LIMITATIONS sections with no filler. Every clause conveys distinct, useful information.

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 single-param, read-only tool with no output schema and no annotations, the description covers purpose, timing, side effects, and limits. It could briefly indicate the shape of the returned findings, but nothing critical for correct invocation is missing.

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?

Only one parameter, and schema description coverage is 100%, so the schema already documents 'source'. The description adds no syntax or formatting guidance for the input, so the baseline 3 applies.

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?

States a specific verb and resource ('Run offline static analysis on Pine Script source code') and enumerates the exact classes of defects detected. An agent can distinguish it from siblings like pine_compile, pine_check, and pine_get_errors without opening the schema.

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?

'WHEN TO USE: Call before compiling code to verify correctness without needing a live TradingView connection' gives clear timing and the offline condition. It implicitly positions itself relative to pine_compile but never names the sibling alternatives or exclusions explicitly.

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