Skip to main content
Glama

portfolio_backtest

Backtest the account's current positions and cash over a historical period to compute performance metrics such as return, CAGR, volatility, Sharpe, Sortino, and drawdown.

Instructions

Backtest the account's current open positions and cash with backtesting.py.

The universe is read from this account's SQLite positions, options without reliable continuous history are reported as skipped, and results include the equity curve, return, CAGR, volatility, Sharpe, Sortino, and drawdown. The default window is five years; request up to 36500 calendar days. This is a current-holdings retrospective, not an out-of-sample strategy test.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNo
startNo
accountYes
lookback_daysNo
commission_bpsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses important behaviors: the universe is read from SQLite positions, options without reliable history are skipped, and it reports specific metrics. It also specifies the default and maximum window. It does not explicitly state that the tool is read-only, but 'current-holdings retrospective' implies no modifications. This is solid coverage.

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 four sentences, front-loaded with the primary purpose, then concise details. Every sentence adds value: data source, metrics, window limits, and the caveat about out-of-sample testing. No filler or redundancy.

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?

The tool has a moderate complexity and an output schema, which covers return values. The description covers purpose, data source, skipped instruments, metrics, and window constraints. It lacks parameter usage details, but overall it provides enough context for an agent to use the tool correctly with defaults.

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

Parameters2/5

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

The schema has 5 parameters with 0% description coverage, so the description must compensate. It only hints at lookback_days via 'default window is five years; request up to 36500 calendar days,' but does not explain start/end alternatives, commission_bps, or the relationship between parameters. This is insufficient for effective parameter use.

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 function: 'Backtest the account's current open positions and cash with backtesting.py.' It specifies the resource (account's positions/cash) and the action (backtest), and distinguishes it from strategy testing: 'This is a current-holdings retrospective, not an out-of-sample strategy test.' This makes it highly specific and differentiates from siblings like strategy_walk_forward.

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 provides clear context for use: it backtests current holdings, with a default window and explicit maximum. It also says what it is not ('not an out-of-sample strategy test'), which serves as a when-not. However, it does not explicitly name alternative tools, so it falls short of a 5.

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/ryanrodrigues25200525-svg/tradingcli'

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