Skip to main content
Glama

edit_and_lint

Apply line edits to a previously linted Pine Script and re-lint to validate changes. Send only modified lines instead of the full script to reduce token usage in fix-and-re-lint cycles.

Instructions

Apply line edits to a previously linted script and re-lint.

Use after lint_script() returns issues. Send only the changed lines instead of the full script — saves tokens on fix-and-re-lint cycles.

Args: script_id: The script_id returned by a previous lint_script() call. edits: List of line edits. Each specifies a 1-based line number, the old text expected on that line, and the new replacement text.

Returns: LintResult with new script_id and fresh lint issues. If script_id not found (expired or different server instance), re-send the full script via lint_script() instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
script_idYes
editsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusYes
countYes
issuesYes
script_idNo
Behavior4/5

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

Annotations indicate non-read-only and non-idempotent behavior, which aligns with the description's 'apply line edits' action. The description adds valuable context beyond annotations: it explains token-saving benefits ('saves tokens on fix-and-re-lint cycles'), mentions script_id expiration, and describes the return format ('LintResult with new script_id and fresh lint issues'). No contradiction with 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 efficiently structured: a purpose statement, usage guidelines, parameter explanations, and return details in four concise paragraphs. Every sentence adds value, with no redundant information, and it's front-loaded with the core functionality.

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?

Given the tool's complexity (editing and re-linting), lack of schema descriptions, and presence of an output schema, the description is complete. It covers purpose, usage, parameters, returns, and edge cases (e.g., script_id expiration). The output schema handles return values, so no need to detail them further.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by detailing both parameters. It explains 'script_id' as 'returned by a previous lint_script() call' and 'edits' as a list specifying '1-based line number, the old text expected on that line, and the new replacement text.' This adds essential meaning not present in the schema.

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: 'Apply line edits to a previously linted script and re-lint.' It distinguishes from sibling tools by explicitly mentioning use after 'lint_script()' and contrasting with 'lint_script()' for full script processing. The verb+resource combination is precise.

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?

Explicit guidance is provided: 'Use after lint_script() returns issues' and 'If script_id not found... re-send the full script via lint_script() instead.' It clearly defines when to use this tool versus the alternative 'lint_script()', including prerequisites and fallback scenarios.

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