Skip to main content
Glama
nonnname

T-Invest MCP Server

by nonnname

get_trading_schedules

Read-only

Retrieve exchange trading schedules for specified periods to plan investment activities and avoid market closures.

Instructions

Получить расписание торгов на бирже из Т-Инвестиций

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exchangeNoКод биржи (например MOEX, SPB, NYSE)MOEX
fromYesНачало периода (ISO 8601)
toYesКонец периода (ISO 8601)

Implementation Reference

  • The handler function inside 'registerGetTradingSchedules' that performs the API call and formats the trading schedule response.
    async ({ exchange, from, to }) => {
      try {
        const response = await client.post<GetTradingSchedulesResponse>(
          API_PATHS.INSTRUMENTS.GET_TRADING_SCHEDULES,
          { exchange, from, to },
        );
    
        if (!response.exchanges || response.exchanges.length === 0) {
          return { content: [{ type: 'text' as const, text: 'Расписание не найдено.' }] };
        }
    
        const lines: string[] = [];
        for (const ex of response.exchanges) {
          lines.push(`Биржа: ${ex.exchange}`);
          for (const day of ex.tradingDays ?? []) {
            const date = formatDate(day.date);
            if (!day.isTradingDay) {
              lines.push(`  ${date}: выходной`);
              continue;
            }
            const start = day.startTime
              ? new Date(day.startTime).toLocaleTimeString('ru-RU', { timeZone: 'Europe/Moscow', hour: '2-digit', minute: '2-digit' })
              : '?';
            const end = day.endTime
              ? new Date(day.endTime).toLocaleTimeString('ru-RU', { timeZone: 'Europe/Moscow', hour: '2-digit', minute: '2-digit' })
              : '?';
            lines.push(`  ${date}: ${start} – ${end}`);
          }
        }
    
        return { content: [{ type: 'text' as const, text: lines.join('\n') }] };
      } catch (error) {
        return {
          content: [{ type: 'text' as const, text: `Ошибка: ${error instanceof Error ? error.message : String(error)}` }],
          isError: true,
        };
      }
    },
  • The 'registerGetTradingSchedules' function which registers the 'get_trading_schedules' tool with the MCP server.
    export function registerGetTradingSchedules(server: McpServer, client: TInvestClient): void {
      server.tool(
        'get_trading_schedules',
        'Получить расписание торгов на бирже из Т-Инвестиций',
        {
          exchange: z.string().default('MOEX').describe('Код биржи (например MOEX, SPB, NYSE)'),
          from: z.string().describe('Начало периода (ISO 8601)'),
          to: z.string().describe('Конец периода (ISO 8601)'),
        },
        READ_ONLY,
        async ({ exchange, from, to }) => {
          try {
            const response = await client.post<GetTradingSchedulesResponse>(
              API_PATHS.INSTRUMENTS.GET_TRADING_SCHEDULES,
              { exchange, from, to },
            );
    
            if (!response.exchanges || response.exchanges.length === 0) {
              return { content: [{ type: 'text' as const, text: 'Расписание не найдено.' }] };
            }
    
            const lines: string[] = [];
            for (const ex of response.exchanges) {
              lines.push(`Биржа: ${ex.exchange}`);
              for (const day of ex.tradingDays ?? []) {
                const date = formatDate(day.date);
                if (!day.isTradingDay) {
                  lines.push(`  ${date}: выходной`);
                  continue;
                }
                const start = day.startTime
                  ? new Date(day.startTime).toLocaleTimeString('ru-RU', { timeZone: 'Europe/Moscow', hour: '2-digit', minute: '2-digit' })
                  : '?';
                const end = day.endTime
                  ? new Date(day.endTime).toLocaleTimeString('ru-RU', { timeZone: 'Europe/Moscow', hour: '2-digit', minute: '2-digit' })
                  : '?';
                lines.push(`  ${date}: ${start} – ${end}`);
              }
            }
    
            return { content: [{ type: 'text' as const, text: lines.join('\n') }] };
          } catch (error) {
            return {
              content: [{ type: 'text' as const, text: `Ошибка: ${error instanceof Error ? error.message : String(error)}` }],
              isError: true,
            };
          }
        },
      );
  • The input schema definition for the 'get_trading_schedules' tool using Zod.
    {
      exchange: z.string().default('MOEX').describe('Код биржи (например MOEX, SPB, NYSE)'),
      from: z.string().describe('Начало периода (ISO 8601)'),
      to: z.string().describe('Конец периода (ISO 8601)'),
    },
Behavior3/5

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

Adds data source attribution ('из Т-Инвестиций') beyond the readOnlyHint annotation, but omits what the schedule includes (trading hours, holidays, sessions) and lacks return format details.

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?

Single sentence, six words, front-loaded with action verb. Efficient structure but undersized given tool complexity and absence of output schema documentation.

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?

Minimal viable coverage for a read-only endpoint. Critical gaps regarding response structure (what defines a trading schedule) and differentiation from related trading status tools, though schema compensates for input requirements.

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% coverage with clear ISO 8601 documentation. Description adds no parameter semantics (default values, exchange code specifics), warranting baseline score.

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?

Clear verb ('получить'/get) and resource ('расписание торгов'/trading schedule from T-Investments), but fails to distinguish from sibling get_trading_status which returns current market state versus this tool's historical/future timetable data.

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?

No when-to-use guidance, prerequisites (required date range), or differentiation from similar market data tools like get_trading_status or get_candles.

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