Skip to main content
Glama
meritz-mcp

meritz-mcp

Official

내 전략 코드 백테스트

meritz_backtest_code

Backtest customer Python trading strategies in an isolated sandbox using demo or Meritz market data, then return a Claude report with simulated fills, fees, and slippage.

Instructions

고객 Python 코드를 격리 실행 환경에서 백테스트하고 Claude 보고서를 표시합니다.

단일파일 def on_bar(ctx): → {'action':'buy'|'sell'|'hold','quantity':선택정수,'reason':선택문자열}. ctx에는 bar, history(현재까지), portfolio(cash/shares), index가 있습니다. 실제 코드만 받고 경로나 키는 받지 않습니다. 파일은 사용자가 선택해 읽은 내용을 전달하세요. source를 반드시 선택하세요. meritz는 symbol·startDate·endDate를 모두 지정해야 고객 계좌키로 시세를 조회합니다. demo는 합성 시세이며 symbol·startDate·endDate·account 값을 함께 지정할 수 없습니다. 표준 라이브러리만 지원. 파일·네트워크·자식프로세스 접근 차단, 최대20초, 메모리는 20ms 간격 감시(하드 상한 아님), 단일종목 일봉 다음봉 시가 가상체결. macOS 에서 소스로 실행할 때만 지원하며 단일 실행 파일(.mcpb·바이너리)에서는 거부됩니다. 실패시 격리 없는 실행이나 합성 시세로 대체하지 않습니다.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>",
      "source": "<source>"
    },
    "name": "meritz_backtest_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
feeBpsNo
sourceYes
symbolNo
accountNo
endDateNo
startDateNo
initialCashNo
slippageBpsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A4.2/5.0
Behavior5/5

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

The annotations only say readOnlyHint=false, openWorldHint=true, destructiveHint=false; the description adds a large amount beyond that. It discloses sandbox characteristics (file, network and child-process access blocked), a 20-second ceiling, memory sampled at 20ms intervals with no hard cap, the next-bar-open virtual fill model on single-symbol daily bars, the no-fallback-on-failure policy, and the platform restriction that it is rejected in a packaged .mcpb/binary. These are the operational facts an agent needs before running untrusted code, not a paraphrase of structured fields.

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 purpose is front-loaded, then the code contract, then the source-dependent data rules, then the sandbox and platform limits — a sensible order with almost no padding. It is dense but each line carries operational weight; the memory-monitoring aside ('20ms interval, not a hard cap') is the closest thing to surplus detail.

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 9-parameter tool that executes untrusted code with no output schema, the definition covers the risky and easily-misused parts: sandbox limits, runtime ceiling, execution model, platform requirement and failure behavior. The remaining shortfall is that it never sketches the report/result the caller receives, even though no output schema exists to explain it, and it omits the cost/position sizing parameters.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must carry all meaning, and it covers most of the 9 parameters: code's on_bar contract and ctx contents (bar, history, portfolio, index), source's required enum and its tie to the tool's own name, and the conditional rules for symbol, startDate, endDate and account. The gap is feeBps, slippageBps and initialCash, which are never mentioned and must be inferred from their names and defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence gives a specific verb and resource: it backtests customer-supplied Python code in an isolated execution environment and renders a Claude report. That is far more than a restatement of the name. It stops short of a 5 because it never distinguishes itself from siblings such as meritz_backtest_demo or meritz_backtest_run, and its own 'demo' source mode overlaps conceptually with the meritz_backtest_demo sibling, leaving the routing choice unresolved.

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?

It states concrete conditions: source is mandatory, 'meritz' requires symbol/startDate/endDate, 'demo' forbids symbol/startDate/endDate/account, only actual source text may be passed (no paths or keys), standard library only, and macOS source-run only. What it lacks is a statement of when to choose this tool over the other backtest siblings (compare/run/validate/demo), so the agent knows the invocation contract but not the sibling boundary.

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