Skip to main content
Glama
PublicDotCom

Public.com MCP Server

Official
by PublicDotCom

cancel_and_replace_order

Destructive

Cancel an existing order and replace it with new order parameters, including type, quantity, and price, in a single atomic operation.

Instructions

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

⚠️ This modifies an existing order.

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. 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
order_idYes
order_typeYes
time_in_forceNoDAY
quantityNo
limit_priceNo
stop_priceNo
expiration_timeNo
account_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the safety profile is covered. The description adds the atomicity behavior and a warning about modification. Yet it omits details such as reversal, prerequisites (e.g., order must be in a cancelable state), or response structure. Given annotation coverage, a score of 3 is appropriate.

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

Conciseness4/5

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

The description is well-structured with a clear header and a bulletized list of parameters. It is front-loaded with the purpose. While slightly verbose, every sentence provides useful information. It could be tighter but remains efficient.

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 presence of an output schema (return values not needed), annotations covering safety, and 8 parameters explained, the description is largely complete. It could mention error conditions or constraints (e.g., cannot cancel filled orders) but overall provides sufficient context for correct tool usage.

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

Parameters4/5

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

Schema parameter description coverage is 0%, so the description carries the full burden. It explains each parameter with sensible defaults and conditions (e.g., expiration_time required when time_in_force is GTD). It also lists valid values for order_type and time_in_force, adding meaning beyond schema names. Minor lack of full type details, but overall adds substantial value.

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 clearly states 'Atomically cancel an existing order and replace it with new parameters.' This specifies the action (cancel and replace) and resource (order). It effectively distinguishes from sibling tools like cancel_order and place_order by emphasizing atomicity.

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?

The description communicates that this tool is for atomic replacement, implying it should be used when a simultaneous cancel and replace is needed. However, it lacks explicit guidance on when not to use it or alternatives like cancel_order followed by place_order. The context is clear but not exhaustive.

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