Pine Script v6 Documentation

Pine Script v6 documentation lookup, function validation, and linting for AI code generation

我該用這個嗎

品質與安全性

A
說明品質
100%
結構描述完整度
84%
命名品質
98%
汙染風險
100%
權限相符程度
100%
協定合規性
100%

根據工具定義與協定合規性的自動化分析。

上下文成本

~1,710Token(工具定義)
~886 B典型回應大小
中等的注意力影響(128k 上下文的 1.34%)

這是每次將伺服器的工具載入模型上下文時所消耗的約略 token 數量。數量越高,可用於其他工作的注意力就越少。

安裝

一鍵安裝

將以下內容加入你的 `claude_desktop_config.json` 檔案:

{
  "mcpServers": {
    "pinescript-mcp": {
      "command": "uvx",
      "args": [
        "pinescript-mcp"
      ]
    }
  }
}

可執行的套件

pypipinescript-mcp0.6.17stdio

遠端端點

https://pinescript-mcp.fly.dev/mcpstreamable-http
https://pinescript-mcp.fly.dev/ssesse

它能做什麼

工具清單

工具(10)

🟢 唯讀🟡 寫入🔴 刪除⚪ 未知
🟢list_docs

USE WHEN discovering what Pine Script v6 documentation is available. Returns a categorised list of doc file paths with one-line descriptions. AFTER calling this tool, call get_doc(path) for small files or list_sections(path) then get_section(path, header) for large files (ta.md, strategy.md, collections.md, drawing.md, general.md). Data sourced from bundled Pine Script v6 documentation.

輸入結構描述

{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}
🟢list_sections(path)

USE WHEN navigating a large documentation file before reading a specific section. Returns a newline-separated list of # and ## headers (### excluded) in the file. AFTER calling this tool, call get_section(path, header) with a header from this list. Data sourced from bundled Pine Script v6 documentation.

輸入結構描述

{
  "type": "object",
  "properties": {
    "path": {
      "description": "Documentation file path (e.g., 'reference/functions/ta.md').",
      "type": "string"
    }
  },
  "required": [
    "path"
  ],
  "additionalProperties": false
}
🟢get_doc(path, limit, offset)

USE WHEN reading the full content of a Pine Script v6 documentation file. Returns the file content; when limit is set, a header shows the char range and offset to continue reading. AFTER calling this tool, use offset=<end> to continue if the header indicates more content is available. For large files (ta.md, strategy.md, collections.md, drawing.md, general.md), prefer list_sections() + get_section() instead. Data sourced from bundled Pine Script v6 documentation.

輸入結構描述

{
  "type": "object",
  "properties": {
    "path": {
      "description": "Relative path to the documentation file (e.g., 'reference/functions/ta.md').",
      "type": "string"
    },
    "limit": {
      "default": 0,
      "description": "Maximum characters to return. Use 30000 for large files. 0 = no limit.",
      "minimum": 0,
      "type": "integer"
    },
    "offset": {
      "default": 0,
      "description": "Character offset to start reading from.",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "path"
  ],
  "additionalProperties": false
}
🟢get_section(path, header, include_children)

USE WHEN reading a specific named section from a Pine Script v6 documentation file. Returns the section content from the matched header to the next same-level header, with file path and line range. AFTER calling this tool, call list_sections(path) if the header was not found, or get_section() again with a child header for a narrower subsection. Data sourced from bundled Pine Script v6 documentation.

輸入結構描述

{
  "type": "object",
  "properties": {
    "path": {
      "description": "Documentation file path (e.g., 'reference/functions/strategy.md').",
      "type": "string"
    },
    "header": {
      "description": "Header text to find (e.g., 'strategy.exit()' or '## strategy.exit()').",
      "type": "string"
    },
    "include_children": {
      "default": true,
      "description": "Include nested subsections under the matched header.",
      "type": "boolean"
    }
  },
  "required": [
    "path",
    "header"
  ],
  "additionalProperties": false
}
🟢search_docs(query, max_results)

USE WHEN finding documentation sections that match specific terms across all Pine Script v6 docs. Returns up to max_results sections ranked by match count, each with a preview and a get_section() call hint. AFTER calling this tool, call get_section(file, header) for each result you want to read in full. Data sourced from bundled Pine Script v6 documentation.

輸入結構描述

{
  "type": "object",
  "properties": {
    "query": {
      "description": "Search terms (case-insensitive). Multi-word queries match sections containing ALL terms.",
      "minLength": 1,
      "type": "string"
    },
    "max_results": {
      "default": 5,
      "description": "Maximum sections to return.",
      "maximum": 20,
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "query"
  ],
  "additionalProperties": false
}
🟢get_functions(namespace)

USE WHEN browsing valid Pine Script v6 functions, optionally filtered to a namespace. Returns function names grouped by namespace (e.g. ta.*, strategy.*) or filtered to the requested namespace. AFTER calling this tool, call validate_function(fn_name) to check a specific name, or get_section() to read its documentation. Data sourced from bundled pine_v6_functions.json.

輸入結構描述

{
  "type": "object",
  "properties": {
    "namespace": {
      "default": "",
      "description": "Filter by namespace (e.g., 'ta', 'strategy', 'request'). Empty string returns all functions grouped by namespace.",
      "type": "string"
    }
  },
  "additionalProperties": false
}
🟢validate_function(fn_name)

USE WHEN confirming a Pine Script v6 function name is valid before using it in code. Returns a valid/invalid verdict with namespace suggestions or known replacement hints (e.g. ta.adx → ta.dmi, security → request.security). AFTER calling this tool, call get_functions(namespace) to list all valid functions in the relevant namespace if the function is invalid. Data sourced from bundled pine_v6_functions.json.

輸入結構描述

{
  "type": "object",
  "properties": {
    "fn_name": {
      "description": "Function name to validate (e.g., 'ta.sma', 'strategy.entry', 'plot').",
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "fn_name"
  ],
  "additionalProperties": false
}

輸出結構描述

{
  "type": "object",
  "properties": {
    "result": {
      "type": "string"
    }
  },
  "required": [
    "result"
  ],
  "x-fastmcp-wrap-result": true
}
🟢resolve_topic(query)

USE WHEN looking up an exact Pine Script API term or known concept keyword. Returns the best-matching doc paths with matched keywords and a retrieval suggestion (get_doc or list_sections + get_section). AFTER calling this tool, follow the suggestion: call get_doc() for small files or list_sections() + get_section() for large files. For natural language questions use search_docs() instead. Data sourced from bundled TOPIC_MAP and doc file content scan.

輸入結構描述

{
  "type": "object",
  "properties": {
    "query": {
      "description": "Exact Pine Script term or known concept keyword (e.g., 'ta.rsi', 'strategy.entry', 'repainting').",
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "query"
  ],
  "additionalProperties": false
}

輸出結構描述

{
  "type": "object",
  "properties": {
    "result": {
      "type": "string"
    }
  },
  "required": [
    "result"
  ],
  "x-fastmcp-wrap-result": true
}
🟢list_prompts

List all available prompts. Returns JSON with prompt metadata including name, description, and optional arguments.

輸入結構描述

{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}

輸出結構描述

{
  "type": "object",
  "properties": {
    "result": {
      "type": "string"
    }
  },
  "required": [
    "result"
  ],
  "x-fastmcp-wrap-result": true
}
🟢get_prompt(name, arguments)

Get a prompt by name with optional arguments. Returns the rendered prompt as JSON with a messages array. Arguments should be provided as a dict mapping argument names to values.

輸入結構描述

{
  "type": "object",
  "properties": {
    "name": {
      "description": "The name of the prompt to get",
      "type": "string"
    },
    "arguments": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional arguments for the prompt"
    }
  },
  "required": [
    "name"
  ],
  "additionalProperties": false
}

輸出結構描述

{
  "type": "object",
  "properties": {
    "result": {
      "type": "string"
    }
  },
  "required": [
    "result"
  ],
  "x-fastmcp-wrap-result": true
}

社群

為此伺服器評分

證據

近期觀測

已驗證未記錄版本10 個工具
觀測失敗未記錄版本—
已驗證未記錄版本10 個工具