Skip to main content
Glama

semantic_search_pine_docs

Read-only

Search Pine Script v6 documentation by conceptual or natural-language questions; get ranked chunks with scores, source paths, headers, and get_section hints for full context.

Instructions

USE WHEN answering conceptual, fuzzy, or natural language questions about Pine Script v6. Returns ranked documentation chunks with score, source path, and section header. Each result includes a get_section() call hint for retrieving the full content. AFTER calling this tool, call get_section(path, header) on the top results for complete context. For exact API term lookups use resolve_topic() instead; for keyword grep use search_docs() instead. Data sourced from the ai-ready-data pinescript-v06 semantic index.

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": {
      "query": "<query>"
    },
    "name": "semantic_search_pine_docs"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesNatural language question or description (e.g., 'how to prevent repainting in higher timeframe strategies').
top_kNoNumber of results to return.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.7

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true/openWorldHint=true, and the description adds meaningful context beyond them: the ranked-chunk return shape (score, source path, section header), the embedded get_section hint in each result, and the backing index ('ai-ready-data pinescript-v06'). The chained-call workflow disclosure is genuinely useful behavior no annotation covers.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the 'USE WHEN' trigger and mostly dense, high-value sentences. Slight redundancy: the get_section follow-up is stated twice (result hint and the 'AFTER calling this tool' line), and the closing data-provenance note is lower value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a retrieval tool that participates in a multi-step workflow, the description covers trigger conditions, alternatives, expected result shape, and the mandated follow-up call. With a full output schema also present, nothing an agent needs to invoke it correctly 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?

Schema coverage is 100% and both parameters (query, top_k) already carry descriptions and constraints including the natural-language example and the 1–20 range. The description adds no further parameter semantics beyond what the schema states, so 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+resource (semantic search over Pine Script v6 documentation) and scopes it to conceptual/fuzzy/natural-language questions. It explicitly contrasts itself with resolve_topic (exact API terms) and search_docs (keyword grep), so an agent can pick it apart from its siblings without opening any 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' precondition and names two alternatives with the conditions that select them ('exact API term lookups' → resolve_topic, 'keyword grep' → search_docs). It also gives post-call guidance: follow up with get_section(path, header) on top results, which is the correct workflow for this retrieval tool.

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