Skip to main content
Glama
keel-trade

Keel — Hyperliquid trading strategies

keel_strategy_compose

Idempotent

Create or update Hyperliquid trading strategies from DSL source. Validate and compile with dry-run before persisting.

Instructions

Create or update a strategy from DSL source. With dry_run=true, validates + tries to compile without persisting — use this first to iterate cheaply. With strategy_id set, updates an existing strategy; otherwise creates a new one. Pass exactly one of source (DSL text) or source_file (path).

FIRST-TIME COMPOSING in this session? Invoke the strategy-creation MCP prompt FIRST (see prompts/list). It auto-loads the full decompose → discover → reason → draft workflow plus ~7 knowledge files (reasoning_principles, composition_mechanics, dsl_syntax, mistakes, tool_usage, universe_selection, pipeline_system) — the same knowledge chat-api keeps always-on. Without it you're composing blind and will likely hit common mistakes the skill catalogs. For modifying an existing strategy, invoke strategy-fork-and-iterate instead.

Validation feedback (errors + warnings + type-flow) always surfaces in the response under validation.errors and validation.warnings. Validation does NOT block the save — matches the web app editor + chat-api policy where the user sees issues inline but compile is the actual gate. Only parse and compile errors block. DSL constraints: NO Python import statements (component names like ROC, PriceDataLoader, ForecastScaler are pre-resolved — use them directly). The pipeline must end with a normalizer (ForecastWeightNormalizer or equivalent). Call keel_help(topic='dsl_syntax') for the full DSL reference, or keel_components_search to discover available components. Do NOT use to fork an existing strategy — call keel_strategy_fork. Do NOT use to run a backtest — call keel_backtest_run.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceNoDSL source (raw text). Exactly one of `source` or `source_file` required.
source_fileNoPath to a .py DSL file. Exactly one of `source` or `source_file` required.
strategy_idNoIf set, updates the named strategy; otherwise creates a new one.
nameNoName for the new strategy (create mode).
dry_runNoOnly validate + compile, do not persist.
parent_versionNoOptional commit/version ref this update is based on.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The description adds significant behavioral context beyond annotations: dry_run behavior, validation feedback always returned, validation does not block save, DSL constraints (no import, pipeline normalizer requirement), and references to other tools for help. Annotations already indicate idempotent and non-destructive, and the description aligns without contradiction, enriching the safety profile.

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?

The description is long but each sentence earns its place by adding critical guidance, constraints, or references. It is front-loaded with the core action and then builds context. Minor redundancy (e.g., 'exactly one' restated) but overall efficient for the complexity.

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 complexity (6 parameters, output schema, dry_run mode, update vs. create), the description is fully comprehensive. It covers validation behavior, DSL constraints, first-time workflow, and alternatives. Output schema exists, so return values are presumably documented there, making the description complete.

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 100%, and the description adds crucial context: exactly one of source or source_file required, dry_run purpose to iterate cheaply, parent_version as optional commit ref, and validation feedback structure. This goes beyond the schema's property descriptions, fully clarifying parameter usage.

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 tool's purpose: 'Create or update a strategy from DSL source.' It distinguishes between create (no strategy_id) and update (with strategy_id), and introduces the dry_run mode. This differentiates it from sibling tools like fork or delete.

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?

The description provides explicit when-to-use guidance: use dry_run first for cheap iteration, invoke the strategy-creation prompt for first-time composing, and use strategy-fork-and-iterate for modifying an existing strategy. It also states what NOT to use (fork, backtest), making it exceptionally clear.

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/keel-trade/keel-trade'

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