Skip to main content
Glama

validate_function

Read-onlyIdempotent

Validate Pine Script v6 function names to ensure correct syntax and prevent coding errors by checking validity and providing suggestions.

Instructions

Check if a Pine Script v6 function name is valid.

Args: fn_name: Function name to validate (e.g., "ta.sma", "strategy.entry", "plot")

Returns: ValidationResult with valid status, type, and suggestion if invalid.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fn_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
validYes
typeYes
functionYes
suggestionNo
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and openWorldHint=false, covering safety and idempotency. The description adds minimal behavioral context beyond this, such as the return structure (ValidationResult with status, type, suggestion), but does not detail error handling, rate limits, or other operational traits. It does not contradict annotations.

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

Conciseness5/5

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

The description is front-loaded with the core purpose, followed by structured Args and Returns sections. Every sentence adds value: the first states the tool's function, the second explains the parameter with examples, and the third describes the return value. No wasted words, and the structure enhances clarity.

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?

Given the tool's low complexity (single parameter, no nested objects), rich annotations (covering read-only, idempotent, closed-world), and the presence of an output schema (implied by 'Returns' description), the description is mostly complete. It explains the parameter and return value adequately, though it could benefit from more behavioral details like error cases.

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 description coverage is 0%, so the schema provides no parameter documentation. The description compensates by explaining 'fn_name' as 'Function name to validate' with examples ('ta.sma', 'strategy.entry', 'plot'), adding meaningful semantics beyond the bare schema. However, it does not cover constraints like length or character rules, leaving some gaps.

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?

The description clearly states the specific action ('Check if...is valid') and target resource ('Pine Script v6 function name'), distinguishing it from siblings like 'lint_script' (which analyzes entire scripts) or 'get_functions' (which lists functions). The purpose is precise and unambiguous.

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

Usage Guidelines4/5

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

The description implies usage context (validating Pine Script v6 function names) but does not explicitly state when to use this tool versus alternatives like 'lint_script' for broader script validation or 'get_functions' for listing functions. It provides clear context but lacks explicit exclusions or named alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/paulieb89/pinescript-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server