Skip to main content
Glama
tanmaymish

MarketPulse MCP

by tanmaymish

backtest_strategy

Test an SMA crossover strategy on a stock, comparing its performance to buy-and-hold to identify if the strategy generates higher returns.

Instructions

Backtest a Simple Moving Average (SMA) crossover strategy. [PRO]

Tests: Buy when short SMA crosses above long SMA, sell when it crosses below. Compares strategy return vs buy-and-hold.

Args: symbol: Stock ticker (e.g., RELIANCE, AAPL, TCS) short_window: Short SMA period in days (default: 20) long_window: Long SMA period in days (default: 50) period: Backtest period: 1y, 2y, 5y (default: 2y) initial_capital: Starting capital (default: 100000)

Examples: backtest_strategy("RELIANCE") → Default 20/50 SMA backtest backtest_strategy("AAPL", 10, 30, "5y") → Custom 10/30 SMA, 5 years backtest_strategy("TCS", 50, 200, "5y", 500000) → Golden cross, 5L capital

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNo2y
symbolYes
long_windowNo
short_windowNo
initial_capitalNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses core behavior: tests crossover signals, compares vs buy-and-hold, and accepts custom parameters. It does not mention potential limitations (e.g., data frequency, survivorship bias), but for a computational backtest tool, the essential behavior is transparent.

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 well-structured with the strategy logic up front, followed by a concise parameter list and illustrative examples. Every sentence adds value, and the length is appropriate given the tool's 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?

The tool has an output schema (not shown), so return values need not be described. All input parameters are fully documented with examples. Strategy details and customization options are clear, making the tool easy to invoke correctly.

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?

The schema has 0% description coverage, but the description fully compensates by explaining every parameter with type, default, and meaning (e.g., 'short_window: Short SMA period in days (default: 20)'). It also provides three examples showing different parameter combinations, adding deeper meaning than the raw 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 opens with 'Backtest a Simple Moving Average (SMA) crossover strategy,' which uses a specific verb and resource, clearly distinguishing it from sibling data-retrieval tools. It also outlines the trading logic (buy/sell on crossovers) and the comparison to buy-and-hold, making the tool's function unmistakable.

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 clearly states the strategy mechanics and backtest scope, but it does not explicitly contrast with alternative tools like technical_indicators or stock_historical. It implies usage context through the strategy description and examples, but lacks explicit '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/tanmaymish/MarketPulse-MCP'

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