sahmk-mcp
v0.10.0Official SAHMK MCP server for Saudi market data in AI agents.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_quote Get Quote
Get a real-time quote for a Saudi stock. Use this when the user asks for the current price, change, bid/ask, or trading activity of one stock.
| Parameter | Type | Description |
|---|---|---|
identifier | Stock identifier (preferred): symbol, Arabic/English name, or known alias, e.g. '2222', 'أرامكو', 'الراجحي'. | |
symbol | Legacy alias for identifier. Prefer 'identifier'. |
get_quotes Get Quotes
Get real-time quotes for multiple Saudi stocks in one call. Use this when the user wants to compare several stocks or asks for prices of more than one symbol.
| Parameter | Type | Description |
|---|---|---|
identifiers | List of stock identifiers (preferred): symbol, Arabic/English name, or alias, up to 50 (e.g. ['2222', 'سابك']). | |
symbols | Legacy alias for identifiers. Prefer 'identifiers'. |
get_market_summary Get Market Summary
Get the current Saudi market summary including TASI index level, change, market direction, and advancing/declining stock counts. Use this for questions about the overall market today.
| Parameter | Type | Description |
|---|---|---|
index | Optional market index: 'TASI' or 'NOMU' (alias 'NOMUC' is accepted and normalized). |
get_market_movers Get Market Movers
Get market movers in one curated endpoint. Use this for top gainers, top losers, highest volume leaders, or highest value leaders. Returns a stable schema: type, index, count, items.
| Parameter | Type | Description |
|---|---|---|
type * | string | Mover type: 'gainers', 'losers', 'volume', or 'value'. |
index | Optional market index: 'TASI' or 'NOMU' (alias 'NOMUC' is accepted and normalized). | |
limit | Optional number of results from 1 to 50. |
get_sectors Get Sectors
Get sector performance for the Saudi market. Use this when the user asks for sector-level market moves or a sector snapshot. Returns a stable schema: index, count, items.
| Parameter | Type | Description |
|---|---|---|
index | Optional market index: 'TASI' or 'NOMU' (alias 'NOMUC' is accepted and normalized). |
get_company Get Company
Get a company profile for a Saudi stock, including sector, industry, fundamentals, valuation, technical indicators, and analyst consensus. Use this when the user asks about a company's profile, key metrics, or detailed information.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | Stock identifier (symbol, Arabic/English name, or alias), e.g. '2222', 'أرامكو'. |
get_financials Get Financials
Get company financial statements and key financial data. Use this for income statement, balance sheet, and cash flow requests. Requires exact exchange symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Requires exact exchange symbol. If the user provides a company name, first use companies_list. If a previous tool result included resolved_instrument.symbol, reuse that symbol. Example: '1120'. |
history | Optional history window selector. Common values: latest, 1y, 3y, 5y, 10y, max (backend-dependent). | |
include_partial | Optionally include partial/incomplete statement periods when available. | |
metrics | Optional metrics profile selector. Common values: core, extended (backend-dependent). | |
period | Optional period selector: annual, quarterly, or auto. If both period and statement_period are provided, period takes precedence. | |
result | Optional result shaping selector. Common values: series, latest, raw (backend-dependent). | |
statement_period | Optional explicit statement period selector (annual, quarterly, or auto). Ignored when period is provided. | |
type | Optional financial view selector (e.g. statement family/profile returned by backend). |
get_ratios Get Ratios
Get calculated financial ratios for one Saudi-listed company. Starter returns latest annual core ratios; Pro supports history, quarterly, and extended metrics.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Requires exact exchange symbol. If the user provides a company name, first use companies_list. If a previous tool result included resolved_instrument.symbol, reuse that symbol. Example: '1120'. |
history | string | History window for ratios. |
metrics | string | Metrics profile for ratios. |
period | string | Statement period for ratios. |
compare_symbols Compare Symbols
Compare multiple Saudi-listed companies using normalized financial ratios and key metrics. Starter supports up to 3 symbols; Pro supports up to 10.
| Parameter | Type | Description |
|---|---|---|
symbols * | Symbols to compare as a list (preferred) or comma-separated string. Starter supports up to 3 symbols; Pro supports up to 10. | |
metrics | string | Metrics profile, e.g. 'core' or 'extended'. Default 'core'. |
get_dividends Get Dividends
Get company dividend history and yield data. Use this when the user asks for dividends or payout history. Requires exact exchange symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Requires exact exchange symbol. If the user provides a company name, first use companies_list. If a previous tool result included resolved_instrument.symbol, reuse that symbol. Example: '1120'. |
get_depth Get Depth
Get market depth (order book) for a Saudi stock. Use this for bid/ask ladder, spread, imbalance, and liquidity at the top of book. Requires exact exchange symbol. Plan/entitlement-gated by the API.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Requires exact exchange symbol. If the user provides a company name, first use companies_list. If a previous tool result included resolved_instrument.symbol, reuse that symbol. Example: '2222'. |
levels | Optional number of book levels to request (1-20). Backend default is 5; entitlement may return fewer levels than requested. |
get_trades Get Trades
Get live trade prints for a Saudi stock (Pro+ plan). Without date: the most recent prints, newest first. With date: one session in receive order; follow page.next_cursor while page.has_more is true. Each print has trade_seq, price, quantity, value, optional side (`buy`/`sell`/`null`), and on dated calls market_session. This is the recent tape, not official session volume. Requires exact exchange symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Requires exact exchange symbol. If the user provides a company name, first use companies_list. If a previous tool result included resolved_instrument.symbol, reuse that symbol. Example: '2222'. |
after_seq | Optional: only prints with a greater trade_seq. Requires date. A filter, not a cursor. | |
cursor | Optional page.next_cursor from the previous page. Requires date. | |
date | Optional session date YYYY-MM-DD (Asia/Riyadh). Reads that session from the recent tape (about three days) in receive order and adds a `page` object. Omit for the newest prints. | |
limit | Optional page size (1-200). Backend default is typically 50. |
get_events Get Events
Get AI-generated stock event summaries (Pro+ plan). Use this for recent corporate/news-style events with type, importance, and sentiment. Optionally filter by exact exchange symbol.
| Parameter | Type | Description |
|---|---|---|
limit | Optional max number of events to return (1-100). Backend default is typically 20. | |
symbol | Optional exact exchange symbol filter. Omit for market-wide recent events. Example: '1120'. |
get_historical Get Historical
Get historical OHLCV price data for a Saudi stock over a date range. Use this when the user asks for past prices, price trends, or chart-style historical data.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Requires exact exchange symbol. If the user provides a company name, first use companies_list. If a previous tool result included resolved_instrument.symbol, reuse that symbol. Example: '1120'. |
adjustment | 'capital' (default): exchange Performance Summary print, adjusted for bonus shares, splits, and rights; cash dividends are not removed. 'none': exchange Unadjusted Prices & Volume tab, as printed. adj… | |
from_date | Start date in YYYY-MM-DD format (default: 30 days ago) | |
interval | Bar size. Preferred: '1min', '5min', '15min', '30min', '60min', '1d', '1w', '1mo' (default: '1d'). Legacy aliases accepted: '30m'->'30min', '60m'->'60min', '1m'->'1mo' (monthly, NOT one-minute). Plan… | |
to_date | End date in YYYY-MM-DD format (default: today) |
companies_list Companies List
Discover listed companies and symbols. Use this first to find/validate symbols before quote/company calls.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Page size (must be > 0). |
market | Optional market filter: 'TASI' or 'NOMU' (alias 'NOMUC' is accepted and normalized). | |
offset | integer | Pagination offset (must be >= 0). |
search | Optional text search across symbol/company names for discovery. |
get_portfolios List Portfolios
List the user's SAHMK portfolios, most recently updated first.
| Parameter | Type | Description |
|---|---|---|
workspace_id | Optional workspace id filter. |
get_portfolio Get Portfolio
Get one portfolio by id.
| Parameter | Type | Description |
|---|---|---|
portfolio_id * | integer | Portfolio id (positive integer) from get_portfolios. |
create_portfolio Create Portfolio
Create a portfolio.
| Parameter | Type | Description |
|---|---|---|
name * | string | Portfolio name. Must be unique for this user. |
description | Optional description. | |
metadata | Optional object of your own fields. | |
workspace | Optional workspace id to link. |
get_portfolio_transactions List Portfolio Transactions
List the full transaction ledger for one portfolio, newest first.
| Parameter | Type | Description |
|---|---|---|
portfolio_id * | integer | Portfolio id (positive integer) from get_portfolios. |
create_portfolio_transaction Create Portfolio Transaction
Create one portfolio transaction or an explicit atomic batch. Transactions are append-only by executed_at order; backdated entries before the latest executed_at are rejected.
| Parameter | Type | Description |
|---|---|---|
portfolio_id * | integer | Portfolio id (positive integer) from get_portfolios. |
amount_sar | Single mode: amount in SAR (required). | |
batch_idempotency_key | Batch mode: required key for the whole batch. | |
executed_at | Optional ISO-8601 timestamp. | |
fee_sar | Optional fee in SAR. | |
idempotency_key | Optional key; resending the same key does not create a duplicate. | |
metadata | Optional object of your own fields. | |
notes | Optional note. | |
quantity | Share quantity for buy and sell. | |
symbol | Stock symbol for buy, sell, and dividend. | |
transaction_type | Single mode: transaction type. | |
transactions | Batch mode: list of transactions (each needs transaction_type and amount_sar). Do not combine with single-mode fields. | |
unit_price_sar | Price per share in SAR for buy and sell. |
set_portfolio_holdings Set Portfolio Holdings
Set target holdings for a portfolio with a dry-run/apply plan token flow. Run with dry_run=true first, show the user the plan, and apply only after they confirm. Applying writes ledger transactions.
| Parameter | Type | Description |
|---|---|---|
cash_policy * | string | auto_fund: when the plan needs cash, existing cash is consumed first and only the remaining shortfall is auto-deposited; when the plan releases cash, auto-withdrawal is limited to the amount released… |
holdings * | array | Target holdings: list of {symbol, quantity, avg_cost_sar}. |
portfolio_id * | integer | Portfolio id (positive integer) from get_portfolios. |
scope * | string | 'full': the portfolio should hold exactly these holdings. 'partial': only the listed symbols change. |
dry_run | boolean | True (default) previews the plan. False applies it and needs plan_token. |
expected_latest_transaction_id | Optional guard: apply fails if the ledger moved since the dry run. | |
plan_token | plan.plan_token from the dry run. Required to apply. |
reverse_portfolio_transaction Reverse Portfolio Transaction
Reverse a transaction by id. Only the portfolio's latest transaction can be reversed.
| Parameter | Type | Description |
|---|---|---|
portfolio_id * | integer | Portfolio id (positive integer) from get_portfolios. |
transaction_id * | integer | Transaction id to reverse. |
metadata | Optional object of your own fields. | |
notes | Optional note. |
get_portfolio_summary Get Portfolio Summary
Get cash, holdings, and P&L for one portfolio.
| Parameter | Type | Description |
|---|---|---|
portfolio_id * | integer | Portfolio id (positive integer) from get_portfolios. |
get_portfolio_performance Get Portfolio Performance
Get the daily equity series for one portfolio.
| Parameter | Type | Description |
|---|---|---|
portfolio_id * | integer | Portfolio id (positive integer) from get_portfolios. |
days | Optional window in days (backend default: 30). |