Skip to main content
Glama
nonnname

T-Invest MCP Server

by nonnname

cancel_order

Destructive

Cancel a stock exchange order in T-Invest by providing account and order IDs. Requires confirmation to execute the cancellation.

Instructions

Отменить биржевую заявку в Т-Инвестициях (требуется confirm: true для исполнения)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountIdYesИдентификатор счёта
orderIdYesID заявки (можно получить через get_orders)
confirmNoПередайте true для подтверждения отмены

Implementation Reference

  • The handler logic for the 'cancel_order' tool.
    async ({ accountId, orderId, confirm }) => {
      try {
        if (requireConfirmation && confirm !== true) {
          return {
            content: [{
              type: 'text' as const,
              text: `Подтвердите отмену заявки:\n  ID заявки: ${orderId}\n  Счёт: ${accountId}\n\nДля отмены вызовите повторно с confirm: true`,
            }],
          };
        }
    
        const response = await client.post<CancelOrderResponse>(
          API_PATHS.ORDERS.CANCEL_ORDER,
          { accountId, orderId },
        );
    
        return {
          content: [{ type: 'text' as const, text: `Заявка ${orderId} отменена в ${formatDateTime(response.time)}` }],
        };
      } catch (error) {
        return {
          content: [{ type: 'text' as const, text: `Ошибка: ${error instanceof Error ? error.message : String(error)}` }],
          isError: true,
        };
      }
    },
  • Registration of the 'cancel_order' tool within the server.
    server.tool(
      'cancel_order',
      requireConfirmation
        ? 'Отменить биржевую заявку в Т-Инвестициях (требуется confirm: true для исполнения)'
        : 'Отменить биржевую заявку в Т-Инвестициях',
      {
        accountId: z.string().describe('Идентификатор счёта'),
        orderId: z.string().describe('ID заявки (можно получить через get_orders)'),
        confirm: z.boolean().optional().describe('Передайте true для подтверждения отмены'),
      },
      DESTRUCTIVE,
      async ({ accountId, orderId, confirm }) => {
        try {
          if (requireConfirmation && confirm !== true) {
            return {
              content: [{
                type: 'text' as const,
                text: `Подтвердите отмену заявки:\n  ID заявки: ${orderId}\n  Счёт: ${accountId}\n\nДля отмены вызовите повторно с confirm: true`,
              }],
            };
          }
    
          const response = await client.post<CancelOrderResponse>(
            API_PATHS.ORDERS.CANCEL_ORDER,
            { accountId, orderId },
          );
    
          return {
            content: [{ type: 'text' as const, text: `Заявка ${orderId} отменена в ${formatDateTime(response.time)}` }],
          };
        } catch (error) {
          return {
            content: [{ type: 'text' as const, text: `Ошибка: ${error instanceof Error ? error.message : String(error)}` }],
            isError: true,
          };
        }
      },
    );
Behavior3/5

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

Annotations declare destructiveHint=true and readOnlyHint=false. Description adds valuable behavioral context about the confirmation requirement (confirm: true) needed for execution, but does not describe return values, error conditions, or side effects beyond this safety guard.

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?

Single well-structured sentence with essential information front-loaded. Every element serves a purpose: action verb, resource specification, domain qualifier, and critical safety requirement.

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?

For a destructive operation, mentions the confirmation safety mechanism. However, lacks output description (no output schema exists) and does not indicate what constitutes success/failure or preconditions like order status.

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

Parameters3/5

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

Input schema has 100% description coverage with clear Russian descriptions. Description reinforces the confirm parameter requirement but primarily mirrors schema content. Baseline 3 appropriate given schema completeness.

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?

States specific action (cancel/отменить) and resource (exchange order/биржевую заявку) with domain context (T-Investments). Uses terminology ('биржевую заявку') that implicitly distinguishes from stop orders (sibling cancel_stop_order), though explicit differentiation would strengthen this.

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

Usage Guidelines3/5

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

Provides critical safety guidance that confirm: true is required for execution. However, lacks explicit when-to-use versus sibling cancel_stop_order or guidance on order state prerequisites (e.g., only active 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/nonnname/t-invest-mcp-server'

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