# pinescript

MCP server providing Pine Script v6 documentation for AI assistants.

## Quick Start

```bash
# Connect this server (installs CLI if needed)
npx -y smithery mcp add bouch/pinescript

# Browse available tools
npx -y smithery tool list bouch/pinescript

# Get full schema for a tool
npx -y smithery tool get bouch/pinescript list_docs

# Call a tool
npx -y smithery tool call bouch/pinescript list_docs '{}'
```

## Direct MCP Connection

Endpoint: `https://pinescript--bouch.run.tools`

## Tools (10)

- `list_docs` — List all available Pine Script v6 documentation files with descriptions.
- `list_sections` — List all section headers in a doc file. Use before get_section() to find the right header.
- `get_doc` — Read a specific Pine Script v6 documentation file.
- `get_section` — Get a specific section from a documentation file by its header.
- `search_docs` — Search Pine Script v6 documentation and return matching sections.
- `get_functions` — Get valid Pine Script v6 functions, optionally filtered by namespace.
- `validate_function` — Check if a Pine Script v6 function name is valid.
- `resolve_topic` — Fast lookup for exact Pine Script API terms and known concepts.
- `list_prompts` — List all available prompts.
- `get_prompt` — Get a prompt by name with optional arguments.

```bash
# Get full input/output schema for a tool
npx -y smithery tool get bouch/pinescript <tool-name>
```

## Resources

- `docs://manifest` — START HERE — routing guide that maps Pine Script questions to documentation files and tool call sequences
- `docs://functions` — Complete list of valid Pine Script v6 functions as JSON

## Prompts (3)

- `debug_error` (error_message, code) — Debug a Pine Script compilation error.
- `convert_v5_to_v6` (code) — Convert Pine Script v5 code to v6.
- `explain_function` (function_name) — Explain a Pine Script function in detail.
