list_docs
List all available Pine Script v6 documentation files with descriptions.
Returns files organised by category with descriptions.
For small files use get_doc(path). For large files
(ta.md, strategy.md, collections.md, drawing.md, general.md)
use list_sections(path) then get_section(path, header).
list_sections
List all section headers in a doc file. Use before get_section() to find the right header.
Especially useful for large files like ta.md, strategy.md, collections.md, drawing.md, general.md
which have 50-115 sections each.
Args:
path: Documentation file path (e.g., "reference/functions/ta.md")
Returns top-level section headers (## level) for navigation. Subsections (###) are omitted since get_section(include_children=True) returns them when reading.
get_doc
Read a specific Pine Script v6 documentation file.
For large files (ta.md, strategy.md, collections.md, drawing.md,
general.md) prefer list_sections() + get_section() to avoid
loading 1000-2800 line files into context.
Args:
path: Relative path to the documentation file (e.g., "reference/functions/ta.md")
limit: Maximum characters to return. Use 30000 for large files to avoid token limits.
offset: Character offset to start reading from (default: 0)
Returns the contents with metadata header showing total size and current slice.
get_section
Get a specific section from a documentation file by its header.
Use after list_sections() shows available headers, or after
resolve_topic() / search_docs() identifies the relevant file.
Args:
path: Documentation file path (e.g., "reference/functions/strategy.md")
header: Header text to find (e.g., "strategy.exit()" or "## strategy.exit()")
include_children: Include nested subsections under the header (default: True)
Returns the section content from the header to the next same-level header.
search_docs
Search Pine Script v6 documentation and return matching sections.
Finds sections containing the query and returns previews with
get_section() call hints so you can read the full content.
Args:
query: Exact string to search for (case-insensitive).
max_results: Maximum sections to return (default: 5)
Returns matching sections ranked by relevance with get_section() hints.
get_functions
Get valid Pine Script v6 functions, optionally filtered by namespace.
Use before writing Pine Script to see which functions exist.
For checking a single function name, use validate_function() instead.
Args:
namespace: Filter by namespace (e.g., "ta", "strategy", "request").
Empty string returns all functions grouped by namespace.
Returns a formatted text list of function names.