Skip to main content
Glama
FinamWeb

Finam MCP Server

by FinamWeb

order_cancel

Cancel an exchange order by providing the order ID to manage trading positions on Russian financial markets through the Finam trading platform.

Instructions

Отмена биржевой заявки

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderYesЗаявка
statusYes
exec_idNoИдентификатор исполнения
order_idYesИдентификатор заявки
accept_atNoДата и время принятия заявки
transact_atNoДата и время выставления заявки
withdraw_atNoДата и время отмены заявки

Implementation Reference

  • Handler function for the 'order_cancel' MCP tool (prefixed from 'cancel'), executes the order cancellation via the Finam client.
    @order_mcp.tool(tags={"order"}, meta={"sensitive": True})
    async def cancel(order_id: str) -> OrderState:
        """Отмена биржевой заявки"""
        return await get_finam_client().cancel_order(order_id)
  • src/main.py:15-15 (registration)
    Registers the order_mcp tools with 'order' prefix, making 'cancel' available as 'order_cancel'.
    finam_mcp.mount(order_mcp, prefix="order")
  • Pydantic model for OrderState, used as the return type schema for the order_cancel tool.
    class OrderState(BaseModel):
        """Состояние заявки"""
        order_id: str = Field(..., description="Идентификатор заявки")
        exec_id: str | None = Field(None, description="Идентификатор исполнения")
        status: OrderStatus = Field(..., description="Статус заявки")
        order: Order = Field(..., description="Заявка")
        transact_at: datetime | None = Field(None, description="Дата и время выставления заявки")
        accept_at: datetime | None = Field(None, description="Дата и время принятия заявки")
        withdraw_at: datetime | None = Field(None, description="Дата и время отмены заявки")
  • Underlying API client method called by the handler to perform the order cancellation.
    async def cancel_order(self, order_id: str, account_id: str) -> OrderState:
        """Отмена биржевой заявки"""
        response, ok = await self._exec_request(
            self.RequestMethod.DELETE,
            self._url.format(account_id=account_id) + f"/{order_id}",
        )
    
        if not ok:
            err = ErrorModel(**response)
            raise FinamTradeApiError(f"code={err.code} | message={err.message} | details={err.details}")
    
        return OrderState(**response)
  • Utility function to retrieve the FinamClient instance used in the handler.
    def get_finam_client() -> FinamClient:
        return get_context().get_state("finam_client")
Behavior2/5

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

No annotations are provided, so the description carries full burden. It implies a destructive mutation ('cancel'), but doesn't disclose behavioral traits like whether cancellation is reversible, requires specific permissions, has rate limits, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient phrase in Russian that directly states the tool's action. It's front-loaded with the core purpose and has zero wasted words, making it highly concise and well-structured for its minimal content.

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

Completeness3/5

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

Given the tool's complexity (a destructive mutation with one parameter) and the presence of an output schema (which may cover return values), the description is minimally complete but inadequate. It states what the tool does but lacks usage context, parameter details, and behavioral disclosures. With no annotations and low schema coverage, it should provide more guidance to be fully helpful.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It doesn't mention the 'order_id' parameter at all, leaving its meaning and format undocumented. The description adds no semantic value beyond what the bare schema provides, failing to explain what 'order_id' represents or how to obtain it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Отмена биржевой заявки' (Cancellation of exchange order) clearly states the verb ('cancel') and resource ('exchange order'), making the purpose unambiguous. It distinguishes from siblings like order_place (create) and order_get (read), though it doesn't explicitly name alternatives. The purpose is specific but could be more precise about what type of order is being canceled.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., an existing order), exclusions, or contextual cues. Given siblings like order_get_list and order_get, there's no indication of when cancellation is appropriate versus querying orders.

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/FinamWeb/finam-mcp'

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