Add TPSL support for MCP#122
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the MCP (Model Context Protocol) private place_order tool to support attaching Take-Profit / Stop-Loss (TPSL) triggers, and refactors the MCP private tool registration by extracting the order placement logic into a dedicated module.
Changes:
- Added
take_profit,stop_loss, andtp_sl_typeinputs to the MCPplace_ordertool and wired them intocreate_order_object(...). - Moved
place_ordertool implementation out ofprivate_tools.pyinto a newplace_order_tool.py. - Centralized private REST client creation into
x10/tools/mcp/utils.pyand updated private MCP tools to use it.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| x10/tools/mcp/utils.py | Adds a shared helper to build an authenticated REST client for private MCP tools. |
| x10/tools/mcp/private_tools.py | Refactors tool registration to delegate place_order to the new module and reuses the shared REST client factory. |
| x10/tools/mcp/place_order_tool.py | Introduces the TPSL-enabled place_order MCP tool and supporting orderbook-based pricing logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alexex10
marked this pull request as ready for review
July 6, 2026 13:42
ex10ded
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Demo