Skip to main content
Glama
sacahan

CasualMarket

by sacahan

get_foreign_investment_by_industry

Retrieve foreign ownership statistics by industry, showing shareholding ratios and net buy/sell amounts, to track foreign investors' sector preferences and capital flows.

Instructions

取得外資持股(按產業別)。

提供外資在各產業的持股狀況統計,包括持股比重、買賣超金額等, 可用於觀察外資對不同產業的偏好與資金流向。

使用範例: get_foreign_investment_by_industry() # 查詢外資前10個產業持股(預設) get_foreign_investment_by_industry(count=5) # 查詢外資前5個產業持股 get_foreign_investment_by_industry(count=20) # 查詢外資前20個產業持股

Args: count (int): 限制返回的產業數量,預設為10個產業

Returns: MCPToolResponse[ForeignInvestmentByIndustryData]: 統一格式的回應,包含: - success (bool): 操作是否成功 - data: 外資產業持股資訊,包含: * industry_foreign_investment: 產業列表,每項包含: - 產業別: 產業名稱 - 外資持股: 外資持股相關數據 - 買賣超: 買賣超金額等資訊 * total_industries: 總產業數量 * displayed_industries: 顯示的產業數量 - error (str): 錯誤訊息(失敗時) - tool (str): 工具名稱

Raises: 查詢失敗時返回錯誤回應,可能的原因: - 非交易日無資料 - 資料來源暫時無法存取 - 服務暫時異常

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
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 signals a read-style query through '查詢' and '取得' and documents failure modes (non-trading day, source unavailable, service error). It does not explicitly state 'read-only' or side-effect-free, but for a data-retrieval tool the verb choice is sufficiently clear.

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 clear sections (Examples, Args, Returns, Raises) and is front-loaded with the core purpose. Every section adds information not present in the schema, and the length is justified by the absence of an output schema.

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?

For a one-parameter tool with no annotations and no output schema, the description covers purpose, parameter semantics, call examples, return structure, and error conditions. Nothing an agent needs to invoke and interpret the result is missing.

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?

With 0% schema description coverage, the description fully compensates: it explains the count parameter's meaning, default value (10), and provides three usage examples (count=5, 10, 20). The schema only declares integer and default, so the description is the sole source of semantic content for the parameter.

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 a clear verb-resource pair ('取得外資持股') and immediately scopes it by industry ('按產業別'), then lists the metrics captured (持股比重, 買賣超). This distinguishes it from sibling get_top_foreign_holdings, which addresses holdings at a different granularity, and makes the tool's purpose 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 states an explicit use case ('可用於觀察外資對不同產業的偏好與資金流向') and provides multiple parameterized examples showing intended call patterns. However, it does not explicitly mention alternative tools or state when not to use it, so it stops short of full exclusion guidance.

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