Skip to main content
Glama
nonnname

T-Invest MCP Server

by nonnname

cancel_stop_order

Destructive

Cancel a stop order in T-Invest by providing account ID and stop order ID. Requires confirmation to execute the cancellation.

Instructions

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

Input Schema

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

Implementation Reference

  • The actual tool execution handler logic for canceling a stop order.
    async ({ accountId, stopOrderId, confirm }) => {
      try {
        if (requireConfirmation && confirm !== true) {
          return {
            content: [{
              type: 'text' as const,
              text: `Подтвердите отмену стоп-заявки:\n  ID: ${stopOrderId}\n  Счёт: ${accountId}\n\nДля отмены вызовите повторно с confirm: true`,
            }],
          };
        }
    
        const response = await client.post<CancelStopOrderResponse>(
          API_PATHS.STOP_ORDERS.CANCEL_STOP_ORDER,
          { accountId, stopOrderId },
        );
    
        return {
          content: [{ type: 'text' as const, text: `Стоп-заявка ${stopOrderId} отменена в ${formatDateTime(response.time)}` }],
        };
      } catch (error) {
        return {
          content: [{ type: 'text' as const, text: `Ошибка: ${error instanceof Error ? error.message : String(error)}` }],
          isError: true,
        };
      }
    },
  • Tool registration using the MCP server instance.
    server.tool(
      'cancel_stop_order',
      requireConfirmation
        ? 'Отменить стоп-заявку в Т-Инвестициях (требуется confirm: true)'
        : 'Отменить стоп-заявку в Т-Инвестициях',
      {
        accountId: z.string().describe('Идентификатор счёта'),
        stopOrderId: z.string().describe('ID стоп-заявки (можно получить через get_stop_orders)'),
        confirm: z.boolean().optional().describe('Передайте true для подтверждения отмены'),
      },
      DESTRUCTIVE,
      async ({ accountId, stopOrderId, confirm }) => {
        try {
          if (requireConfirmation && confirm !== true) {
            return {
              content: [{
                type: 'text' as const,
                text: `Подтвердите отмену стоп-заявки:\n  ID: ${stopOrderId}\n  Счёт: ${accountId}\n\nДля отмены вызовите повторно с confirm: true`,
              }],
            };
          }
    
          const response = await client.post<CancelStopOrderResponse>(
            API_PATHS.STOP_ORDERS.CANCEL_STOP_ORDER,
            { accountId, stopOrderId },
          );
    
          return {
            content: [{ type: 'text' as const, text: `Стоп-заявка ${stopOrderId} отменена в ${formatDateTime(response.time)}` }],
          };
        } catch (error) {
          return {
            content: [{ type: 'text' as const, text: `Ошибка: ${error instanceof Error ? error.message : String(error)}` }],
            isError: true,
          };
        }
      },
    );
Behavior4/5

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

While annotations declare destructiveHint=true and readOnlyHint=false, the description adds crucial behavioral context that explicit confirmation (confirm: true) is required to execute the cancellation, indicating a safety-gated destructive operation.

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 sentence structure front-loaded with action, zero redundant content. Parenthetical efficiently conveys critical safety requirement without verbosity.

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?

Adequately complete for destructive operation with 100% schema coverage. References domain context (T-Investments) and safety confirmation. No output schema present to require additional description.

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 coverage is 100%, establishing baseline 3. Description adds value by emphasizing via 'требуется' that confirm parameter is mandatory (not optional), adding semantic weight beyond the schema's literal description.

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?

Description provides specific verb 'Отменить' (Cancel) with specific resource 'стоп-заявку' (stop order) and domain 'Т-Инвестициях'. Clearly distinguishes from sibling 'cancel_order' by explicit resource qualification.

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?

Mentions critical prerequisite '(требуется confirm: true)', providing implicit safety guidance. However, lacks explicit comparison to sibling 'cancel_order' regarding when to use stop-order cancellation vs regular order cancellation.

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