Skip to main content
Glama
Zalfrie

idx-stock-mcp

by Zalfrie

Nilai portofolio saya

get_portfolio
Read-only

Reads local IDX portfolio file and calculates market value, unrealized P/L per stock and total, plus estimated net proceeds if sold, realized P/L, dividends, and warnings.

Instructions

Baca file portofolio lokal (IDX_PORTFOLIO_PATH) lalu hitung nilai pasar, untung/rugi belum terealisasi per saham dan total, serta ESTIMASI hasil bersih jika dijual. Jika file berisi riwayat transactions, posisi dihitung dengan metode harga rata-rata, lengkap dengan realizedPnl (untung/rugi penjualan), dividendsReceived (dividen bruto berdasarkan ex-date), posisi yang sudah habis (closed), dan totals.totalReturn. Juga mengecek stock split setelah tanggal beli. Hanya membaca — tidak bisa membeli atau menjual. WAJIB sampaikan isi 'warnings' ke pengguna bersama angka-angkanya, terutama bila totals.incomplete bernilai true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds substantial context beyond annotations: it describes average-cost accounting, realizedPnl, dividendsReceived, closed positions, totalReturn, stock-split checks, and the mandatory handling of warnings and totals.incomplete. It does not explain failure modes or file-format requirements, keeping it short of the highest score.

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 front-loaded with the core action and then adds necessary computational details in a single dense paragraph. Every sentence contributes unique information, though the lack of visual breaks makes it slightly harder to scan than an ideally structured definition.

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?

With no output schema, the description carries the burden of explaining return values, and it does so by naming key output fields like realizedPnl, dividendsReceived, closed, and totals.totalReturn. It also covers the computation methodology, split handling, and warning requirements, making it complete for an agent to invoke and interpret the tool correctly.

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?

The tool has zero parameters, so the baseline is 4. The description adds the IDX_PORTFOLIO_PATH environment variable as an implicit input source, which is useful context, but there are no parameters whose semantics could be clarified further.

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 states a specific verb+resource combination: reading a local portfolio file and computing market value, unrealized P&L, and estimated net proceeds. It is clearly distinct from sibling tools like get_quote and get_history, which focus on individual securities rather than portfolio-level valuation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the detailed functionality (portfolio valuation from a local file), but there is no explicit guidance on when to choose this tool versus get_quote, get_history, or compare_stocks. The note that it cannot buy or sell provides a boundary, but alternatives are not named.

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

Deploy Server

Other Tools