@vitalyostanin/youtrack-mcp 0.7.3 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README-ru.md CHANGED
@@ -282,11 +282,11 @@ YOUTRACK_TOKEN = "perm:your-token-here"
282
282
  | Tool | Описание | Основные параметры |
283
283
  | --- | --- | --- |
284
284
  | `issue_lookup` | Краткая информация о задаче. **Использование:** Быстрый просмотр базовой информации о задаче без полной детализации. **Возвращает:** предопределенные поля - id, idReadable, summary, description, wikifiedDescription, usesMarkdown, project, parent, assignee. Пользовательские поля не включены. | `issueId` — код задачи (например, `PROJ-123`) |
285
- | `issues_lookup` | Краткая информация о нескольких задачах (пакетный режим, макс 50). **Использование:** Эффективное получение информации о множестве задач одновременно. **Возвращает:** те же поля, что и `issue_lookup`. **Ограничение:** максимум 50 задач за запрос | `issueIds[]` — массив кодов задач (например, `['PROJ-123', 'PROJ-124']`) |
285
+ | `issues_lookup` | Краткая информация о нескольких задачах (пакетный режим, макс 50). **Использование:** Эффективное получение информации о множестве задач одновременно. **Возвращает:** те же поля, что и `issue_lookup`. **Ограничение:** максимум 50 задач за запрос | `issueIds[]` — массив кодов задач (например, `['PROJ-123', 'PROJ-124']`), макс 50; `briefOutput` — опционально (по умолчанию `true`) |
286
286
  | `issue_details` | Режимы краткий/полный для деталей задачи. **Использование:** Просмотр деталей задачи. **Краткий (по умолчанию):** предопределённые поля — id, idReadable, summary, description, wikifiedDescription, usesMarkdown, created, updated, resolved, project, parent, assignee, reporter, updater, watchers(hasStar). **Полный (`briefOutput=false`):** добавляет `customFields(id,name,value(id,name,presentation),$type,possibleEvents(id,presentation))`, включая поле `State`. | `issueId` — код задачи; `briefOutput` — опционально (по умолчанию `true`) |
287
- | `issues_details` | Режимы краткий/полный для множества задач (макс 50). **Краткий:** предопределённые поля. **Полный (`briefOutput=false`):** добавляет `customFields` для каждой задачи. **Замечание:** объём ответа может быть большим, поэтому по умолчанию используется краткий режим. **Ограничение:** максимум 50 задач за запрос | `issueIds[]` — массив кодов задач; `briefOutput` — опционально (по умолчанию `true`) |
288
- | `issue_comments` | Комментарии задачи. **Использование:** Просмотр всех комментариев к задаче. **Возвращает:** предопределенные поля - id, text, textPreview, usesMarkdown, author (id, login, name), created, updated | `issueId` — код задачи |
289
- | `issues_comments` | Комментарии для нескольких задач (пакетный режим, макс 50). **Использование:** Эффективное получение комментариев для множества задач одновременно. **Ограничение:** максимум 50 задач за запрос | `issueIds[]` — массив кодов задач |
287
+ | `issues_details` | Режимы краткий/полный для множества задач (макс 50). **Краткий:** предопределённые поля. **Полный (`briefOutput=false`):** добавляет `customFields` для каждой задачи. **Замечание:** объём ответа может быть большим, поэтому по умолчанию используется краткий режим. **Ограничение:** максимум 50 задач за запрос | `issueIds[]` — массив кодов задач, макс 50; `briefOutput` — опционально (по умолчанию `true`) |
288
+ | `issue_comments` | Комментарии задачи. **Использование:** Просмотр всех комментариев к задаче. **Возвращает:** предопределенные поля - id, text, textPreview, usesMarkdown, author (id, login, name), created, updated, commentUrl (прямая ссылка на комментарий) | `issueId` — код задачи |
289
+ | `issues_comments` | Комментарии для нескольких задач (пакетный режим, макс 50). **Использование:** Эффективное получение комментариев для множества задач одновременно. **Ограничение:** максимум 50 задач за запрос | `issueIds[]` — массив кодов задач, макс 50; `briefOutput` — опционально (по умолчанию `true`) |
290
290
  | `issue_create` | Создание новой задачи в YouTrack. **Использование:** Создание задач, подзадач (через `parentIssueId`), назначение исполнителя при создании, одновременное создание дополнительных связей. **Возвращает:** стандартные поля созданной задачи (id, idReadable, summary, description, wikifiedDescription, usesMarkdown, project, parent, assignee). Пользовательские поля не включены. | `projectId` — внутренний ID проекта, `summary`, опционально `description`, `parentIssueId`, `assigneeLogin`, `stateName`, `usesMarkdown`, `links[]` — массив объектов связи |
291
291
  | `issue_update` | Обновление существующей задачи. **Использование:** Изменение summary, description, родительской задачи. **Примечание:** для изменения исполнителя используйте `issue_assign`. Пустая строка в `parentIssueId` удаляет родителя. **Возвращает:** стандартные поля обновленной задачи | `issueId` — ID или код задачи, опционально `summary`, `description`, `parentIssueId` (пустая строка очищает родителя), `usesMarkdown` |
292
292
  | `issue_assign` | Назначение исполнителя для задачи. **Использование:** Изменение исполнителя задачи. Поддерживает алиас `me` для текущего пользователя. **Возвращает:** стандартные поля обновленной задачи | `issueId` — ID или код задачи, `assigneeLogin` — логин исполнителя или `me` |
@@ -300,10 +300,10 @@ YOUTRACK_TOKEN = "perm:your-token-here"
300
300
 
301
301
  | Tool | Описание | Основные параметры |
302
302
  | --- | --- | --- |
303
- | `issue_links` | Список связей (линков) для задачи: «relates to», «duplicate», «parent/child». Возвращает id связи, направление (inward/outward), тип связи и краткую информацию о связанной задаче | `issueId` — код задачи |
303
+ | `issue_links` | Список связей (линков) для задачи: «relates to», «duplicate», «parent/child». Возвращает id связи, направление (inward/outbound), тип связи и краткую информацию о связанной задаче | `issueId` — код задачи |
304
304
  | `issue_link_types` | Список доступных типов связей в YouTrack. Полезно для подбора корректного типа при создании связи | — |
305
- | `issue_link_add` | Создание связи между двумя задачами | `sourceId` — исходная задача, `targetId` — целевая задача, `linkType` — имя или id типа связи (например, `Relates` или UUID) |
306
- | `issue_link_delete` | Удаление существующей связи по её id для указанной задачи | `issueId` — код задачи, `linkId` — id связи |
305
+ | `issue_link_add` | Создание связи между двумя задачами | `sourceId` — исходная задача, `targetId` — целевая задача, `linkType` — имя или id типа связи (например, `Relates` или UUID), опционально `direction` (`outbound` или `inbound`) |
306
+ | `issue_link_delete` | Удаление существующей связи по её id для указанной задачи | `issueId` — код задачи, `linkId` — id связи для удаления |
307
307
 
308
308
  **issue_create — дополнительные параметры:**
309
309
 
@@ -363,7 +363,7 @@ YOUTRACK_TOKEN = "perm:your-token-here"
363
363
  | `article_update` | Обновление существующей статьи. **Использование:** Редактирование содержимого, изменение заголовка статьи. **Возвращает:** предопределенные поля обновленной статьи | `articleId` — ID статьи, опционально `summary` — новый заголовок, `content` — новое содержимое, `usesMarkdown`, `returnRendered` |
364
364
  | `article_search` | Поиск статей в базе знаний по тексту. **Использование:** Полнотекстовый поиск по заголовкам и содержимому статей, поиск документации. Поддерживает фильтрацию по проекту и родительской статье. **Возвращает:** предопределенные поля - id, idReadable, summary, usesMarkdown, contentPreview (если `returnRendered=true`), parentArticle, project. Поле content не включено для производительности. **Ограничение:** минимум 2 символа в запросе, максимум 200 результатов | `query` — текст для поиска (минимум 2 символа), опционально `projectId` — фильтр по проекту, `parentArticleId` — фильтр по родительской статье, `limit` — максимум результатов (макс 200), `returnRendered` — вернуть отрендеренный preview содержимого |
365
365
  | `articles_search` | Полнотекстовый поиск по статьям базы знаний YouTrack по заголовку и содержимому. Возвращает `webUrl` для прямого перехода. | `query`, `limit`, `skip`, опционально `projectId`, `parentArticleId` |
366
- | `issues_search` | Полнотекстовый поиск по задачам YouTrack по summary, description и комментариям. | `query`, `limit`, `skip` |
366
+ | `issues_search` | Полнотекстовый поиск по задачам YouTrack по summary, description и комментариям. Если `query` не указан или пуст, будут возвращены все задачи. Поддерживает фильтрацию по проектам, исполнителю, автору, статусу и типу. | `query` (необязательный), `limit`, `skip`, `countOnly` (необязательный), `projects` (необязательный), `assignee` (необязательный), `reporter` (необязательный), `state` (необязательный), `type` (необязательный) |
367
367
  | `issues_list` | Список задач по фильтрам с поддержкой сортировки. **Использование:** Дашборды, аудит командной загрузки, подготовка батч-операций. Поддерживает фильтрацию по проектам, датам создания/обновления, статусам, типам, исполнителю. **Возвращает:** краткие или полные данные задачи в зависимости от `briefOutput`, а также информацию о сортировке и пагинации. | Фильтры: `projectIds`, `createdAfter/Before`, `updatedAfter/Before`, `statuses`, `assigneeLogin`, `types`; сортировка: `sortField` (`created`/`updated`), `sortDirection` (`asc`/`desc`); пагинация: `limit`, `skip`; формат: `briefOutput` |
368
368
  | `issues_count` | Подсчёт задач с теми же фильтрами, что у `issues_list`, с разбивкой по проектам. **Использование:** Быстрая оценка объёмов работ перед загрузкой полного списка, подготовка аналитических отчётов. При запросе одного проекта обращается к `/api/issuesGetter/count`, иначе считает постранично. | Те же фильтры, что и `issues_list`; опциональный `top` ограничивает объём ручной агрегации (при необходимости частичной выборки) |
369
369
 
package/README.md CHANGED
@@ -21,31 +21,35 @@ MCP server for comprehensive YouTrack integration with the following capabilitie
21
21
 
22
22
  ## Table of Contents
23
23
 
24
- - [Requirements](#requirements)
25
- - [Installation](#installation)
26
- - [Using npx (Recommended)](#using-npx-recommended)
27
- - [Using Claude MCP CLI](#using-claude-mcp-cli)
28
- - [Manual Installation (Development)](#manual-installation-development)
29
- - [Development & Release](#development--release)
30
- - [GitHub Actions Workflows](#github-actions-workflows)
31
- - [Setting up NPM_TOKEN](#setting-up-npmtoken)
32
- - [Release Process](#release-process)
33
- - [Manual Build & Test](#manual-build--test)
34
- - [Running the server (stdio)](#running-the-server-stdio)
35
- - [Configuration for Code (Recommended)](#configuration-for-code-recommended)
36
- - [Configuration for Claude Code CLI](#configuration-for-claude-code-cli)
37
- - [Configuration for VS Code Cline](#configuration-for-vs-code-cline)
38
- - [MCP Tools](#mcp-tools)
39
- - [Service](#service)
40
- - [Issues](#issues)
41
- - [Issue Links](#issue-links)
42
- - [Issue Stars](#issue-stars)
43
- - [Work Items](#work-items)
44
- - [Users and Projects](#users-and-projects)
45
- - [Articles](#articles)
46
- - [Search](#search)
47
- - [Important Notes](#important-notes)
48
- - [Destructive Operations](#destructive-operations)
24
+ - [YouTrack MCP Server](#youtrack-mcp-server)
25
+ - [Table of Contents](#table-of-contents)
26
+ - [Requirements](#requirements)
27
+ - [Installation](#installation)
28
+ - [Using npx (Recommended)](#using-npx-recommended)
29
+ - [Using Claude MCP CLI](#using-claude-mcp-cli)
30
+ - [Manual Installation (Development)](#manual-installation-development)
31
+ - [Development \& Release](#development--release)
32
+ - [GitHub Actions Workflows](#github-actions-workflows)
33
+ - [CI Workflow (`.github/workflows/ci.yml`)](#ci-workflow-githubworkflowsciyml)
34
+ - [Publish Workflow (`.github/workflows/publish.yml`)](#publish-workflow-githubworkflowspublishyml)
35
+ - [Setting up NPM\_TOKEN](#setting-up-npm_token)
36
+ - [Release Process](#release-process)
37
+ - [Manual Build \& Test](#manual-build--test)
38
+ - [Running the server (stdio)](#running-the-server-stdio)
39
+ - [Configuration for Code (Recommended)](#configuration-for-code-recommended)
40
+ - [Configuration for Claude Code CLI](#configuration-for-claude-code-cli)
41
+ - [Configuration for VS Code Cline](#configuration-for-vs-code-cline)
42
+ - [MCP Tools](#mcp-tools)
43
+ - [Service](#service)
44
+ - [Issues](#issues)
45
+ - [Issue Links](#issue-links)
46
+ - [Issue Stars](#issue-stars)
47
+ - [Work Items](#work-items)
48
+ - [Users and Projects](#users-and-projects)
49
+ - [Articles](#articles)
50
+ - [Search](#search)
51
+ - [Important Notes](#important-notes)
52
+ - [Destructive Operations](#destructive-operations)
49
53
 
50
54
  ## Requirements
51
55
 
@@ -282,8 +286,11 @@ Tools return either `structuredContent` (default) or a text `content` item, depe
282
286
  | Tool | Description | Main Parameters |
283
287
  | --- | --- | --- |
284
288
  | `issue_lookup` | Brief issue information | `issueId` — issue code (e.g., PROJ-123) |
289
+ | `issues_lookup` | Brief information about multiple issues (batch mode, max 50) | `issueIds[]` — array of issue codes (e.g., ['PROJ-123', 'PROJ-124']), max 50; `briefOutput` — optional boolean (default `true`) |
285
290
  | `issue_details` | Issue details with brief/full modes | `issueId` — issue code; `briefOutput` — optional boolean (default `true`). Brief: predefined fields only. Full (`false`): adds `customFields` including `State` |
291
+ | `issues_details` | Detailed information about multiple issues (batch mode, max 50). Brief (default): predefined fields only. Full (`briefOutput=false`): adds `customFields` for each issue | `issueIds[]` — array of issue codes, max 50; `briefOutput` — optional boolean (default `true`) |
286
292
  | `issue_comments` | Issue comments | `issueId` — issue code |
293
+ | `issues_comments` | Comments for multiple issues (batch mode, max 50) | `issueIds[]` — array of issue codes, max 50; `briefOutput` — optional boolean (default `true`) |
287
294
  | `issue_create` | Create issue | `projectId`, `summary`, optional `description`, `parentIssueId`, `assigneeLogin`, `stateName`, `usesMarkdown`, `links` (array of link objects) |
288
295
  | `issue_update` | Update existing issue | `issueId`, optionally `summary`, `description`, `parentIssueId` (empty string clears parent), `usesMarkdown` |
289
296
  | `issue_assign` | Assign issue to user | `issueId`, `assigneeLogin` (login or `me`) |
@@ -304,8 +311,8 @@ Tools return either `structuredContent` (default) or a text `content` item, depe
304
311
  | --- | --- | --- |
305
312
  | `issue_links` | List links for an issue (relates to, duplicate, parent/child). Returns link id, direction, linkType, and counterpart issue brief | `issueId` — issue code |
306
313
  | `issue_link_types` | List available link types | — |
307
- | `issue_link_add` | Create a link between two issues | `sourceId`, `targetId`, `linkType` (name or id) |
308
- | `issue_link_delete` | Delete a link by id for a specific issue | `issueId`, `linkId` |
314
+ | `issue_link_add` | Create a link between two issues | `sourceId`, `targetId`, `linkType` (name or id), optionally `direction` (`outbound` or `inbound`) |
315
+ | `issue_link_delete` | Delete a link by id for a specific issue | `issueId` — issue code, `linkId` — link id to delete |
309
316
 
310
317
  ### Issue Stars
311
318
 
@@ -355,13 +362,14 @@ Tools return either `structuredContent` (default) or a text `content` item, depe
355
362
  | `article_update` | Update article | `articleId`, optionally `summary`, `content`, `usesMarkdown`, `returnRendered` |
356
363
  | `article_search` | Search articles in knowledge base | `query`, optionally `projectId`, `parentArticleId`, `limit`, `returnRendered` |
357
364
  | `articles_search` | Full-text search across YouTrack knowledge base articles by title and content. Returns `webUrl` for direct access. | `query`, `limit`, `skip`, optionally `projectId`, `parentArticleId` |
358
- | `issues_search` | Full-text search across YouTrack issues by summary, description, and comments. | `query`, `limit`, `skip` |
365
+ | `issues_search` | Full-text search across YouTrack issues by summary, description, and comments. If `query` is not provided or empty, all issues will be returned. Supports filtering by projects, assignee, reporter, state, and type. | `query` (optional), `limit`, `skip`, `countOnly` (optional), `projects` (optional), `assignee` (optional), `reporter` (optional), `state` (optional), `type` (optional) |
359
366
 
360
367
  ### Search
361
368
 
362
369
  | Tool | Description | Main Parameters |
363
370
  | --- | --- | --- |
364
- | `article_search` | Search articles in knowledge base | `query`, optionally `projectId`, `parentArticleId`, `limit`, `returnRendered` |
371
+ | `articles_search` | Full-text search across YouTrack knowledge base articles by title and content. Returns `webUrl` for direct access | `query` (min 2 chars), `limit` (default 50, max 200), `skip`, optionally `projectId`, `parentArticleId` |
372
+ | `issues_search` | Full-text search across YouTrack issues by summary, description, and comments. If `query` is not provided or empty, all issues will be returned. Supports filtering by projects, assignee, reporter, state, and type | `query` (optional), `limit` (default 50, max 200), `skip`, `countOnly` (optional), `projects` (optional), `assignee` (optional), `reporter` (optional), `state` (optional), `type` (optional) |
365
373
  | `issues_list` | List issues across projects with filtering and sorting | Filters: `projectIds`, `createdAfter/Before`, `updatedAfter/Before`, `statuses`, `assigneeLogin`, `types`; Sorting: `sortField`, `sortDirection`; Pagination: `limit`, `skip`; Output mode: `briefOutput` |
366
374
  | `issues_count` | Count issues using same filters as `issues_list`, returns per-project breakdown | Same filters as above, optional `top` to cap manual aggregation when many projects are involved |
367
375
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitalyostanin/youtrack-mcp",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "scripts": {
5
5
  "build": "tsc -p tsconfig.json",
6
6
  "postbuild": "chmod +x dist/index.js",
@@ -1,23 +1,43 @@
1
1
  import { z } from "zod";
2
2
  import type { YoutrackClient } from "../youtrack-client.js";
3
3
  export declare const issuesSearchArgs: {
4
- query: z.ZodString;
4
+ query: z.ZodOptional<z.ZodString>;
5
5
  limit: z.ZodDefault<z.ZodNumber>;
6
6
  skip: z.ZodDefault<z.ZodNumber>;
7
+ projects: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
+ assignee: z.ZodOptional<z.ZodString>;
9
+ reporter: z.ZodOptional<z.ZodString>;
10
+ state: z.ZodOptional<z.ZodString>;
11
+ type: z.ZodOptional<z.ZodString>;
7
12
  };
8
- export declare const issuesSearchSchema: z.ZodObject<{
9
- query: z.ZodString;
13
+ export declare const issuesSearchSchema: z.ZodDefault<z.ZodObject<{
14
+ query: z.ZodOptional<z.ZodString>;
10
15
  limit: z.ZodDefault<z.ZodNumber>;
11
16
  skip: z.ZodDefault<z.ZodNumber>;
17
+ projects: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
18
+ assignee: z.ZodOptional<z.ZodString>;
19
+ reporter: z.ZodOptional<z.ZodString>;
20
+ state: z.ZodOptional<z.ZodString>;
21
+ type: z.ZodOptional<z.ZodString>;
12
22
  }, "strip", z.ZodTypeAny, {
13
- query: string;
14
23
  skip: number;
15
24
  limit: number;
25
+ reporter?: string | undefined;
26
+ assignee?: string | undefined;
27
+ type?: string | undefined;
28
+ query?: string | undefined;
29
+ projects?: string[] | undefined;
30
+ state?: string | undefined;
16
31
  }, {
17
- query: string;
32
+ reporter?: string | undefined;
33
+ assignee?: string | undefined;
34
+ type?: string | undefined;
35
+ query?: string | undefined;
18
36
  skip?: number | undefined;
37
+ projects?: string[] | undefined;
19
38
  limit?: number | undefined;
20
- }>;
39
+ state?: string | undefined;
40
+ }>>;
21
41
  export declare function issuesSearchHandler(client: YoutrackClient, rawInput: unknown): Promise<{
22
42
  [x: string]: unknown;
23
43
  content: ({
@@ -1,21 +1,88 @@
1
1
  import { z } from "zod";
2
2
  import { toolSuccess, toolError } from "../utils/tool-response.js";
3
3
  export const issuesSearchArgs = {
4
- query: z.string().min(2).describe("Search string for issues (e.g., 'login error')"),
4
+ query: z
5
+ .string()
6
+ .optional()
7
+ .describe("Search string for issues (e.g., 'login error'). If not provided or empty, all issues will be returned. You can also use YouTrack Query Language (e.g., 'State: Open', 'Type: Bug')"),
5
8
  limit: z.number().int().positive().max(200).default(50).describe("Max results per page"),
6
9
  skip: z.number().int().nonnegative().default(0).describe("Offset for pagination"),
10
+ projects: z.array(z.string().min(1)).optional().describe("Filter by project short names (e.g., ['PROJ', 'TEST'])"),
11
+ assignee: z.string().optional().describe("Filter by assignee login (e.g., 'john.doe' or 'me')"),
12
+ reporter: z.string().optional().describe("Filter by reporter/author login (e.g., 'john.doe' or 'me')"),
13
+ state: z.string().optional().describe("Filter by state/status (e.g., 'Open', 'In Progress', 'Fixed')"),
14
+ type: z.string().optional().describe("Filter by issue type (e.g., 'Bug', 'Feature', 'Task')"),
7
15
  };
8
- export const issuesSearchSchema = z.object(issuesSearchArgs);
16
+ export const issuesSearchSchema = z
17
+ .object({
18
+ query: z
19
+ .string()
20
+ .optional()
21
+ .describe("Search string for issues (e.g., 'login error'). If not provided or empty, all issues will be returned. You can also use YouTrack Query Language (e.g., 'State: Open', 'Type: Bug')"),
22
+ limit: z.number().int().positive().max(200).default(50).describe("Max results per page"),
23
+ skip: z.number().int().nonnegative().default(0).describe("Offset for pagination"),
24
+ projects: z.array(z.string().min(1)).optional().describe("Filter by project short names (e.g., ['PROJ', 'TEST'])"),
25
+ assignee: z.string().optional().describe("Filter by assignee login (e.g., 'john.doe' or 'me')"),
26
+ reporter: z.string().optional().describe("Filter by reporter/author login (e.g., 'john.doe' or 'me')"),
27
+ state: z.string().optional().describe("Filter by state/status (e.g., 'Open', 'In Progress', 'Fixed')"),
28
+ type: z.string().optional().describe("Filter by issue type (e.g., 'Bug', 'Feature', 'Task')"),
29
+ })
30
+ .default({});
9
31
  export async function issuesSearchHandler(client, rawInput) {
10
32
  const input = issuesSearchSchema.parse(rawInput);
11
33
  try {
34
+ // Build query parameters
35
+ let { query = "" } = input;
36
+ const { limit = 50, skip = 0 } = input;
37
+ // Collect all filters
38
+ const filters = [];
39
+ // Add project filter
40
+ if (input.projects && input.projects.length > 0) {
41
+ const projectFilter = input.projects.map((p) => `project: ${p}`).join(" or ");
42
+ filters.push(`(${projectFilter})`);
43
+ }
44
+ // Add assignee filter
45
+ if (input.assignee) {
46
+ filters.push(`assignee: ${input.assignee}`);
47
+ }
48
+ // Add reporter filter
49
+ if (input.reporter) {
50
+ filters.push(`reporter: ${input.reporter}`);
51
+ }
52
+ // Add state filter
53
+ if (input.state) {
54
+ filters.push(`State: {${input.state}}`);
55
+ }
56
+ // Add type filter
57
+ if (input.type) {
58
+ filters.push(`Type: {${input.type}}`);
59
+ }
60
+ // Combine query with filters
61
+ if (filters.length > 0) {
62
+ const combinedFilters = filters.join(" and ");
63
+ query = query ? `(${query}) and ${combinedFilters}` : combinedFilters;
64
+ }
65
+ // Fetch issues
12
66
  const data = await client["getWithFlexibleTop"]("/api/issues", {
13
- query: input.query,
14
- $top: input.limit,
15
- $skip: input.skip,
67
+ query,
68
+ $top: limit,
69
+ $skip: skip,
16
70
  fields: "id,idReadable,summary,project(shortName,name),assignee(name,login)",
17
71
  });
18
- return toolSuccess(data);
72
+ // Count logic
73
+ const allIssues = Array.isArray(data) ? data : [];
74
+ const total = allIssues.length;
75
+ const byProject = {};
76
+ for (const issue of allIssues) {
77
+ const project = issue.project?.shortName ?? "UNKNOWN";
78
+ byProject[project] = (byProject[project] ?? 0) + 1;
79
+ }
80
+ const result = {
81
+ total,
82
+ byProject: Object.entries(byProject).map(([project, count]) => ({ project, count })),
83
+ items: allIssues,
84
+ };
85
+ return toolSuccess(result);
19
86
  }
20
87
  catch (error) {
21
88
  return toolError(error);
@@ -92,6 +92,18 @@ const issueChangeStateArgs = {
92
92
  .describe("Target state name (e.g., 'In Progress', 'Open', 'Fixed', 'Verified'). Case-insensitive."),
93
93
  };
94
94
  const issueChangeStateSchema = z.object(issueChangeStateArgs);
95
+ const issuesCountArgs = {
96
+ projectIds: z.array(z.string().min(1)).optional().describe("Filter by project IDs or short names"),
97
+ createdAfter: z.string().optional().describe("Filter by creation date (YYYY-MM-DD or timestamp)"),
98
+ createdBefore: z.string().optional().describe("Filter by creation date (YYYY-MM-DD or timestamp)"),
99
+ updatedAfter: z.string().optional().describe("Filter by update date (YYYY-MM-DD or timestamp)"),
100
+ updatedBefore: z.string().optional().describe("Filter by update date (YYYY-MM-DD or timestamp)"),
101
+ statuses: z.array(z.string().min(1)).optional().describe("Filter by state names"),
102
+ types: z.array(z.string().min(1)).optional().describe("Filter by issue types"),
103
+ assigneeLogin: z.string().optional().describe("Filter by assignee login"),
104
+ top: z.number().int().positive().optional().describe("Maximum number of issues to count (optional limit)"),
105
+ };
106
+ const issuesCountSchema = z.object(issuesCountArgs);
95
107
  export function registerIssueTools(server, client) {
96
108
  server.tool("issue_lookup", "Get brief information about YouTrack issue. Note: Returns predefined fields only - id, idReadable, summary, description, wikifiedDescription, usesMarkdown, project (id, shortName, name), parent (id, idReadable), assignee (id, login, name). Custom fields are not included.", issueIdArgs, async (rawInput) => {
97
109
  try {
@@ -278,5 +290,17 @@ export function registerIssueTools(server, client) {
278
290
  return errorResponse;
279
291
  }
280
292
  });
293
+ server.tool("issues_count", "Count YouTrack issues with optional filters. Returns total count and breakdown by projects. Use for: Getting accurate issue counts without pagination limits, analyzing issue distribution across projects.", issuesCountArgs, async (rawInput) => {
294
+ try {
295
+ const payload = issuesCountSchema.parse(rawInput);
296
+ const result = await client.countIssues(payload);
297
+ const response = toolSuccess(result);
298
+ return response;
299
+ }
300
+ catch (error) {
301
+ const errorResponse = toolError(error);
302
+ return errorResponse;
303
+ }
304
+ });
281
305
  }
282
306
  //# sourceMappingURL=issue-tools.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitalyostanin/youtrack-mcp",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "scripts": {
5
5
  "build": "tsc -p tsconfig.json",
6
6
  "postbuild": "chmod +x dist/index.js",