Skip to main content
Glama

monte_carlo_factor_mining

Read-onlyIdempotent

Run Monte Carlo simulations of random stock portfolios to identify significant factors driving Sharpe ratios. Outputs factor rankings, Pearson r, R², and scatter data for hypothesis generation.

Instructions

蒙地卡羅隨機選股因子挖掘(B2 Factor Mining)— 翻轉「哪個組合最好」(brute force selection bias 必死)為「好組合的共同特徵是什麼」。跑 N 個隨機組合 → 對每個組合算因子暴露(動能 / 波動度 / 規模 / 產業集中度...)→ 對 (factor, sharpe) 做迴歸找出顯著因子。輸出:因子排序 + Pearson r + R² + scatter raw data。屬研究工具,輸出應做新策略假設源、不該直接交易。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
marketNo市場 TW 或 US,預設 TW
startDateYes回測起日 YYYY-MM-DD
endDateYes回測迄日 YYYY-MM-DD
nPicksNo隨機抽幾檔(2-50,預設 10)
nSimulationsNo次數(100-5000,預設 1000)
Behavior4/5

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

Annotations indicate readOnlyHint=true, destructiveHint=false, idempotentHint=true, so the tool is safe. The description adds behavioral context: it runs simulations, performs regression, and outputs scatter data. It describes the tool as a research tool, which implies no side effects. No contradiction with annotations.

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 moderately long but every sentence adds value: it explains the core concept, methodology, output, and usage guidance. It is well-structured and front-loaded with the purpose. Slightly verbose but efficient overall.

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?

Given the complexity and no output schema, the description covers the key aspects: what it does, how it works (regression), what it outputs (factor ranking, Pearson r, R², scatter raw data), and how to use it (research only, not for trading). It is complete enough for an agent to understand when to invoke and what to expect.

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 description coverage is 100% (all 5 parameters have descriptions). The tool's description adds context about the purpose (e.g., '跑 N 個隨機組合' refers to nSimulations) but does not significantly elaborate beyond the schema. Baseline of 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's purpose: Monte Carlo random stock selection factor mining. It explains the methodology (run N random portfolios, calculate factor exposures, regress factor vs Sharpe, output factor ranking with Pearson r, R², scatter raw data). It is distinct from the sibling tool 'monte_carlo_random_portfolio' which likely does only random portfolio generation, not factor mining.

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 states it is a research tool and that output should be used as source for new strategy hypotheses, not for direct trading. This provides clear when-to-use and when-not-to-use guidance, though it does not name alternative tools explicitly.

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/kevinlin49361128-stack/stock-analyzer-mcp'

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