Skip to main content
Glama

validate_strategy

Check a Python FLOX strategy for syntax errors, required hooks, and forbidden patterns without executing the code, ensuring it's safe before running backtests.

Instructions

Static-analysis check on a Python FLOX strategy: AST parses, expected hooks present (on_trade / on_bar), no forbidden patterns (eval, exec, import tricks). Use this before running user-authored strategy code. Does NOT execute the code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPython source for the strategy module/class.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv0.6.9
  2. Removedv0.6.8
  3. First observedv0.6.3

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations provided, the description carries full behavioral burden. It is transparent about the safety profile: 'Does NOT execute the code' and details the checks performed (AST parse, hook presence, forbidden patterns). This fully discloses the tool's behavior without relying on 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 three compact sentences: what it does, when to use, and what it doesn't do. Every sentence earns its place with no redundancy or fluff. It is extremely concise and well-structured.

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?

For a simple one-parameter validation tool with no output schema and no annotations, the description is quite complete. It covers purpose, usage, and non-execution. However, it does not specify the return format or error behavior, which would be useful given no output schema exists. Slight gap prevents a perfect score.

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 the parameter 'code' is already described as 'Python source for the strategy module/class.' The description adds minimal extra meaning by calling it a 'Python FLOX strategy' and 'user-authored strategy code,' but does not significantly enhance parameter semantics beyond schema. Baseline 3 is appropriate.

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 performs a 'Static-analysis check on a Python FLOX strategy' with specific behaviors: AST parses, hooks present, no forbidden patterns. It distinguishes from sibling tools by emphasizing it does not execute code and is specifically for pre-run validation, making it specific 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 explicitly says 'Use this before running user-authored strategy code,' providing a clear when-to-use context. It does not mention alternatives or exclusions, but the guidance is strong enough for typical selection. A minor gap is not contrasting with similar sibling like validate_strategy_no_lookahead.

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

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/FLOX-Foundation/flox'

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