Skip to content

Add a combined screen for leveraged instruments - #3

Closed
LurigeLars wants to merge 11 commits into
AnteWall:mainfrom
LurigeLars:upstream/leveraged-screen
Closed

LurigeLars wants to merge 11 commits into
AnteWall:mainfrom
LurigeLars:upstream/leveraged-screen

Conversation

@LurigeLars

Copy link
Copy Markdown
Contributor

This adds a read-only screen_leveraged_instruments tool for a common workflow that currently takes several MCP calls: finding certificates and warrants for the same underlying.

The tool takes a verified underlying order_book_id, a long/short direction, and optional product families. It:

  • queries certificates and warrants concurrently
  • paginates each family internally, with a hard cap of 200 results per family
  • returns the fields that are useful for an initial comparison, such as issuer, leverage when available, bid/ask, spread, turnover, stop-loss and underlying identity
  • keeps results from one product family if the other Avanza endpoint is temporarily unavailable

Prices and spreads are deliberately described as discovery data rather than execution quotes, since Avanza may return stale or missing values outside market hours.

I kept the change focused on the existing FastMCP 3.4.7 contracts. It does not change dependencies, transport, authentication or existing tool behavior.

Tests cover combined certificate/warrant collection, spread calculation, partial upstream failure, input validation and the registered MCP contract.

@LurigeLars LurigeLars closed this Sep 23, 2026
@LurigeLars
LurigeLars deleted the upstream/leveraged-screen branch September 23, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant