Skip to main content
Glama

generate_strategy_params

Generates strategy parameters code from a JSON configuration, automatically assigning parameters to components, registering with the framework, and building Optuna search spaces with crossover constraints.

Instructions

Generate strategy_params.py from params_to_optimize.json.

    Deterministic code generation: parses the JSON → determines parameter
    ownership across components → emits ComponentParameterTemplate classes
    + framework registration + optuna_search_space with crossover
    constraints → writes the target file. Period parameters that exceed
    the frequency-appropriate indicator cap are auto-clamped and reported.

    Args:
        params_file_path: Absolute path to ``params_to_optimize.json``.
        output_path: Absolute path to write ``strategy_params.py``.
        frequency: ``"interday"`` (caps: TEMA≤62, ADX≤93, default≤180)
            or ``"intraday"`` (caps: TEMA≤500, ADX≤750, default≤1000).

    Returns ``{"success": bool, "output_path": str, "corrections":
    [{"param", "type", "old_*", "new_*", "cap", "category", "changes"?}],
    "message": str}``. Parse / IO failures surface as
    ``success=False`` rather than raising.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
params_file_pathYes
output_pathYes
frequencyNointerday
Behavior4/5

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

Describes deterministic code generation steps, auto-clamping, and error handling (success=False vs raising). No annotations provided, so description compensates well.

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?

Well-structured with clear front-loaded purpose. Each sentence adds value, but could be slightly more concise without losing clarity.

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?

Covers inputs, processing, outputs, error handling, and return format. Despite no output schema or annotations, description provides complete context for invocation.

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?

Schema coverage is 0%, but description adds thorough semantics: absolute paths for params_file_path and output_path, frequency with caps and default. Fully compensates for missing schema descriptions.

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?

Clearly states the tool generates strategy_params.py from params_to_optimize.json with specific verb and resource. Differentiates from sibling tools that are mainly descriptive or validation-focused.

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?

Provides clear context for when to use (code generation from JSON) and explains frequency-dependent caps. However, no explicit alternatives or when-not-to-use guidance.

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/DolphinQuant/echolon'

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