Skip to main content
Glama

explain_pine_error

Read-only

Diagnoses Pine Script compilation or runtime errors, returning relevant documentation chunks and a common-errors reference so you can identify the cause and fix it quickly.

Instructions

USE WHEN diagnosing a Pine Script compilation or runtime error. Returns semantically relevant documentation chunks alongside the bundled common-errors reference. If the error mentions an unknown function name, also call validate_function() after this tool. AFTER calling this tool, call validate_function(fn_name) if the error mentions an unrecognised function; call get_section() on any suggested doc paths to read full context. Data sourced from ai-ready-data semantic index and bundled concepts/common_errors.md.

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": {
      "error_text": "<error_text>"
    },
    "name": "explain_pine_error"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNoOptional: the Pine Script code that produced the error.
error_textYesThe exact error message from the TradingView Pine Script compiler or runtime.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.7

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the description's job is to add context, which it does: it discloses the return content (semantically relevant doc chunks plus a bundled common-errors reference) and the data provenance (semantic index plus concepts/common_errors.md). It omits behavior on no-match results or result-size/pagination, which keeps it off a 5.

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 'USE WHEN' opener is correctly front-loaded and the data-provenance line is compact. However, the validate_function follow-up is stated twice in near-identical wording ('If the error mentions an unknown function name, also call validate_function() after this tool' and 'call validate_function(fn_name) if the error mentions an unrecognised function'), which is duplicated instruction that should have been consolidated.

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?

An output schema exists, so return values needn't be explained, and the description still covers trigger, follow-up chaining, and data source. For a two-parameter, read-only lookup this is nearly complete; only no-match behavior is unaddressed.

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 coverage is 100%, so both error_text and the optional code parameter are already documented in the schema and the baseline is 3. The description only implies that error_text should contain a function name when relevant to trigger validate_function; it adds no format or syntax guidance for the optional `code` parameter.

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+resource: diagnosing Pine Script compilation/runtime errors by returning relevant documentation chunks plus a bundled common-errors reference. It distinguishes itself from validate_function by scoping that sibling to the 'unknown function name' case, so an agent can tell the two apart without opening either schema.

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

Usage Guidelines5/5

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

Opens with an explicit 'USE WHEN diagnosing a Pine Script compilation or runtime error' trigger and then gives concrete follow-up routing: call validate_function(fn_name) after this tool for unrecognised function errors, and call get_section() on suggested doc paths for full context. The alternative-conditional is spelled out rather than left to inference.

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