Skip to main content
Glama
PublicDotCom

Public.com MCP Server

Official
by PublicDotCom

cancel_and_replace_order

Destructive

Atomically cancel an existing order and replace it with updated parameters for stocks, options, or crypto. Adjust quantity, price, or type in one operation.

Instructions

Atomically cancel an existing order and replace it with new parameters.

⚠️ This modifies an existing order.

Supported for equity, option, and crypto quantity orders.

Args: order_id: UUID of the existing order to cancel and replace. order_type: MARKET, LIMIT, STOP, or STOP_LIMIT for the replacement. time_in_force: DAY or GTD. Default is DAY. quantity: New quantity for the replacement order. Mutually exclusive with amount. amount: New notional dollar amount for the replacement order. Mutually exclusive with quantity. limit_price: New limit price (for LIMIT/STOP_LIMIT orders). stop_price: New stop price (for STOP/STOP_LIMIT orders). expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountNo
order_idYes
quantityNo
account_idNo
order_typeYes
stop_priceNo
limit_priceNo
time_in_forceNoDAY
expiration_timeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

The description adds meaningful context beyond the annotations: the warning '⚠️ This modifies an existing order' reinforces the destructiveHint, and it states atomicity, supported asset types (equity, option, crypto), and parameter mutual exclusivity. These are useful behavioral details not present in the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: a one-sentence purpose, a clear warning, a supported-assets line, and a compact Args list. Every element serves a purpose, and the front-loaded purpose ensures the agent immediately understands the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (9 parameters, no schema descriptions) and the presence of an output schema, the description is quite thorough. It covers all parameters, conditions, and constraints. It lacks explicit failure behavior (e.g., what if the original order cannot be cancelled), but the atomicity hint partially addresses this. Minor gap prevents a 5.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description carries full responsibility for parameter explanation. The Args section covers all 9 parameters with enums (order_type), defaults (time_in_force), mutual exclusivity (quantity vs amount), conditional requirements (expiration_time when GTD), and context (account_id optional if env var set). This fully compensates for the schema gap.

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 opens with 'Atomically cancel an existing order and replace it with new parameters,' which is a specific verb+resource statement that clearly distinguishes this tool from siblings like cancel_order and place_order. The atomicity qualifier adds valuable scope.

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

Usage Guidelines4/5

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

While it doesn't explicitly mention alternatives like 'use this instead of cancel_order then place_order,' the phrase 'Atomically cancel an existing order and replace it' provides clear context for when this tool is appropriate. However, there are no explicit exclusions or when-not-to-use guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PublicDotCom/publicdotcom-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server