smartoption-mcp
v0.17.0MCP servers exposing the smartoption-ai APIs as tools for AI agents (Claude Desktop / Claude Code / any MCP client).
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
find_user
Locate a user by free-text identifier (email / username / wechat_id / discord_id). Wraps ``GET /api/admin/users?search=<query>&page_size=10``. The backend does a case-insensitive contains-match across those four fields, so partial inputs work ("@gmail" returns every Gmail user). For an exact ObjectId lookup use ``get_user_detail(user_id)`` instead. Returns the raw list page (``items`` + ``total`` + ``page``); typical flow is to inspect ``items``, pick the right row, then call ``get_user_detail`` for the heavy detail view.
| Parameter | Type | Description |
|---|---|---|
query * | string |
list_users
List users with the same filters the admin UI exposes. Args: page / page_size: standard pagination, page_size capped server-side at 100. search: optional free-text match against username / email / discord_id / wechat_id (case-insensitive ILIKE). subscribed_only: when true, restricts to users who currently have an effective tier (matches the "有效等级" filter on the admin user list page).
| Parameter | Type | Description |
|---|---|---|
page | integer | |
page_size | integer | |
search | ||
subscribed_only | boolean |
get_user_detail
Composite detail view for one user — user row + subscription + broker configs. Backend has no ``GET /api/admin/users/<id>`` endpoint, so the user row is sourced via ``list_users?search=<identifier>`` and filtered to the matching ``user_id`` client-side. The ``identifier`` argument is the email / username / wechat_id / discord_id you used to find the user; pass whatever ``find_user`` returned. Omitting it skips the user-row portion (subscription + broker configs are still fetched). Calls (best-effort — a 4xx/5xx in one slice does not abort the others; t…
| Parameter | Type | Description |
|---|---|---|
user_id * | string | |
identifier |
list_user_broker_configurations
List a user's saved broker configurations (IB / Tiger / Futu / Moomoo / cloud-broker accounts). Secrets (api keys, account passwords) are redacted server-side. Use this when answering "which brokers does user X have set up?" / "is their IB config still valid?".
| Parameter | Type | Description |
|---|---|---|
user_id * | string |
get_user_stripe_charges
List a user's Stripe charge history (newest first). Each row carries ``id``, ``amount``, ``currency``, ``status``, ``created`` (epoch), ``description``, and the linked ``payment_intent``. Useful for "did this user actually pay for X?" / "show me last month's refunds".
| Parameter | Type | Description |
|---|---|---|
user_id * | string | |
limit | integer |
create_user
Create a new user account. WRITE — two-phase confirm gate. Args: email: required, unique case-insensitive. username: 3-30 chars, ``[a-zA-Z0-9_-]+``, unique. password: ≥ 8 chars. wechat_id: optional. roles: defaults to ``["user"]``. ``"super_admin"`` may only be granted by another super_admin. platinum_expires_at / diamond_expires_at: ISO 8601 / YYYY-MM-DD to grant a manual-trial tier; omit for a non-subscribed user. confirmed: dry-run gate. False = preview only, True = actually create. Stripe customer creation is attempted…
| Parameter | Type | Description |
|---|---|---|
email * | string | |
password * | string | |
username * | string | |
confirmed | boolean | |
diamond_expires_at | ||
platinum_expires_at | ||
roles | ||
wechat_id |
update_user
General-purpose user edit (PATCH). WRITE — two-phase confirm gate. Only fields whose argument is non-None are sent. To clear an optional string field, pass an empty string ``""`` (backend treats that as "set to null"). For subscription-tier expiry changes use ``update_user_subscription`` instead — it lives on the same PATCH route but its dry-run preview is shaped for that workflow. Args: user_id: ObjectId. is_active: enable/disable login. roles: replaces the entire list. ``super_admin`` grants/revokes require a super_admin caller. a…
| Parameter | Type | Description |
|---|---|---|
user_id * | string | |
active_broker | ||
confirmed | boolean | |
discord_id | ||
email | ||
invite_code | ||
is_active | ||
legacy_comment | ||
roles | ||
wechat_id |
update_user_subscription
Adjust a user's manual-trial / per-use tier dates. WRITE — gate. Wraps the same PATCH ``/api/admin/users/<id>`` endpoint as ``update_user``, but only allows the subscription-related fields so the dry-run preview is purpose-shaped (admin sees "platinum extended to 2026-12-31" instead of a generic patch diff). Args: platinum_expires_at: YYYY-MM-DD or ISO datetime. Pass empty string ``""`` (or null) to clear the expiry. diamond_expires_at: same shape as above. subscription_kind: one of ``none / manual_trial / per_use``. Optional — backen…
| Parameter | Type | Description |
|---|---|---|
user_id * | string | |
confirmed | boolean | |
diamond_expires_at | ||
platinum_expires_at | ||
subscription_kind |
reset_user_password
Force-set a user's password. WRITE — gate. Backend POST ``/api/admin/users/<id>/password``. Only super_admin may reset another super_admin's password; other admins are rejected at the backend. Args: user_id: ObjectId. new_password: 1-30 characters (backend's current bound; UI shows users a stricter ≥ 8 rule but the admin reset accepts any). confirmed: dry-run gate.
| Parameter | Type | Description |
|---|---|---|
new_password * | string | |
user_id * | string | |
confirmed | boolean |
list_strategies
List every unified ``Strategy`` row across all users (admin view). Wraps ``GET /api/admin/strategies``. The backend does not currently accept filters server-side, so this tool fetches the full list and optionally filters client-side by ``visibility`` (PRIVATE / UNLISTED / PUBLIC) and / or ``owner_id`` (the user the strategy belongs to, matched against the ``user_id`` summary field). Each row carries ``id``, ``name``, ``deployment_status``, ``visibility``, ``access_policy``, ``user_id``, and the bound virtual-account snapshot (``total_value``, ``cash_balance``,…
| Parameter | Type | Description |
|---|---|---|
owner_id | ||
visibility |
get_strategy_detail
Full admin detail view for one strategy. Calls ``GET /api/admin/strategies/<id>/detail`` which returns the deployment state, last signal/tick log heads, pod status, KV-state size, and the bound virtual account snapshot. When ``include_source=True``, also fetches the strategy's draft + deployed source code via ``/source-code``. Default is False to keep the payload small; set True when reviewing logic before approve/redeploy.
| Parameter | Type | Description |
|---|---|---|
strategy_id * | string | |
include_source | boolean |
update_strategy_access_policy
Change a strategy's visibility and / or access policy. WRITE — gate. Wraps PATCH ``/api/admin/strategies/<id>/access-policy``. Args: visibility: one of ``PRIVATE`` / ``UNLISTED`` / ``PUBLIC`` (case- insensitive; uppercased server-side). Omit to leave unchanged. access_policy_type: one of ``allow_all`` / ``allow_user_ids`` / ``subscription_tier``. Omit (and leave ``access_policy_value`` None) to leave the policy unchanged. access_policy_value: shape depends on type — allow_all → not required, pass None. allow…
| Parameter | Type | Description |
|---|---|---|
strategy_id * | string | |
access_policy_type | ||
access_policy_value | ||
confirmed | boolean | |
visibility |
redeploy_strategy
Force a redeploy of a strategy (admin shortcut). WRITE — gate. POST ``/api/admin/strategies/<id>/redeploy``. Bypasses the review gate (admin already holds approve power) and rebuilds the strategy's runner pod via ``user_strategy_deploy_service.deploy(skip_review_gate=True)``. Use this to recover from a stuck deployment, pick up a config change, or quickly re-test a fix without going through the review queue. Two-phase: ``confirmed=False`` returns a preview, ``confirmed=True`` actually triggers the redeploy.
| Parameter | Type | Description |
|---|---|---|
strategy_id * | string | |
confirmed | boolean |
stop_strategy_admin
Scale a strategy's runner pod to 0 (admin force-stop). WRITE — gate. POST ``/api/admin/strategies/<id>/stop``. Reuses ``user_strategy_deploy_service.stop`` — same effect as the strategy owner stopping their own strategy, but admin can do it for any user. Named ``stop_strategy_admin`` rather than ``stop_strategy`` because the customer MCP already exposes a customer-scoped ``stop_strategy`` and we don't want the LLM to confuse the two surfaces.
| Parameter | Type | Description |
|---|---|---|
strategy_id * | string | |
confirmed | boolean |
list_strategy_review_queue
List ``StrategyReviewRequest`` rows for the admin review queue. GET ``/api/admin/strategy-review/queue``. Args: status: one of ``queued`` (default — oldest SLA first), ``approved``, ``rejected``, ``withdrawn``. Pass ``queued`` to see the work pending an admin decision. limit: 1-500, default 100.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
status | string |
get_strategy_review_detail
Full detail for one review request. Returns the linked strategy summary, the snapshot of the submitted code (so you can read what's being reviewed without a separate ``get_strategy_detail`` call), the submitter user, and the review's SLA deadline + any prior admin notes.
| Parameter | Type | Description |
|---|---|---|
review_id * | string |
approve_strategy_review
Approve a strategy review (transitions review to ``approved`` and triggers a deploy via the review service). WRITE — gate. POST ``/api/admin/strategy-review/<id>/approve``. Two-phase: read ``get_strategy_review_detail`` first to confirm what you're approving, then call this with ``confirmed=False`` for a dry-run preview, then ``confirmed=True`` to actually approve.
| Parameter | Type | Description |
|---|---|---|
review_id * | string | |
confirmed | boolean |
reject_strategy_review
Reject a strategy review with a reason. WRITE — gate. POST ``/api/admin/strategy-review/<id>/reject``. Args: review_id: ObjectId. category: short rejection category — free-text in the current backend (no enum check), but the UI typically uses one of ``code_quality`` / ``policy_violation`` / ``incomplete`` / ``other``. Pick the closest match so the author can filter. text: human-readable rejection note shown to the submitter. confirmed: dry-run gate.
| Parameter | Type | Description |
|---|---|---|
category * | string | |
review_id * | string | |
text * | string | |
confirmed | boolean |