backlog-mcp-server 0.17.0 → 0.18.1

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.
Files changed (160) hide show
  1. package/README.ja.md +31 -32
  2. package/README.md +36 -32
  3. package/build/auth/oauthRoutes.js +53 -1
  4. package/build/backlog/customFields.js +12 -9
  5. package/build/createBacklogMcpServer.d.ts +4 -6
  6. package/build/createBacklogMcpServer.js +4 -12
  7. package/build/handlers/builders/composeToolHandler.d.ts +1 -1
  8. package/build/handlers/builders/composeToolHandler.js +15 -9
  9. package/build/handlers/transformers/wrapWithFieldPicking.d.ts +14 -1
  10. package/build/handlers/transformers/wrapWithFieldPicking.js +30 -36
  11. package/build/httpMcpServer.js +8 -1
  12. package/build/index.js +20 -15
  13. package/build/lib.d.ts +1 -1
  14. package/build/loadDescriptionOverrides.js +2 -2
  15. package/build/reportUnknownOverrideKeys.js +0 -1
  16. package/build/tools/addDocument.d.ts +3 -3
  17. package/build/tools/addDocument.js +18 -3
  18. package/build/tools/addIssue.d.ts +3 -3
  19. package/build/tools/addIssue.js +32 -2
  20. package/build/tools/addIssueComment.d.ts +3 -3
  21. package/build/tools/addIssueComment.js +14 -2
  22. package/build/tools/addProject.d.ts +3 -3
  23. package/build/tools/addProject.js +22 -2
  24. package/build/tools/addPullRequest.d.ts +3 -3
  25. package/build/tools/addPullRequest.js +26 -2
  26. package/build/tools/addPullRequestComment.d.ts +3 -3
  27. package/build/tools/addPullRequestComment.js +12 -2
  28. package/build/tools/addRelatedIssue.d.ts +3 -3
  29. package/build/tools/addRelatedIssue.js +33 -2
  30. package/build/tools/addVersionMilestone.d.ts +3 -3
  31. package/build/tools/addVersionMilestone.js +12 -2
  32. package/build/tools/addWatching.d.ts +3 -3
  33. package/build/tools/addWatching.js +12 -2
  34. package/build/tools/addWiki.d.ts +3 -3
  35. package/build/tools/addWiki.js +16 -2
  36. package/build/tools/countIssues.d.ts +3 -3
  37. package/build/tools/countIssues.js +3 -2
  38. package/build/tools/deleteIssue.d.ts +3 -3
  39. package/build/tools/deleteIssue.js +32 -2
  40. package/build/tools/deleteProject.d.ts +3 -3
  41. package/build/tools/deleteProject.js +22 -2
  42. package/build/tools/deleteVersion.d.ts +3 -3
  43. package/build/tools/deleteVersion.js +12 -2
  44. package/build/tools/deleteWatching.d.ts +3 -3
  45. package/build/tools/deleteWatching.js +12 -2
  46. package/build/tools/getCategories.d.ts +3 -3
  47. package/build/tools/getCategories.js +8 -2
  48. package/build/tools/getCustomFields.d.ts +3 -3
  49. package/build/tools/getCustomFields.js +22 -2
  50. package/build/tools/getDocument.d.ts +3 -3
  51. package/build/tools/getDocument.js +17 -2
  52. package/build/tools/getDocumentTree.d.ts +3 -3
  53. package/build/tools/getDocumentTree.js +7 -2
  54. package/build/tools/getDocuments.d.ts +3 -3
  55. package/build/tools/getDocuments.js +17 -2
  56. package/build/tools/getGitRepositories.d.ts +3 -3
  57. package/build/tools/getGitRepositories.js +17 -2
  58. package/build/tools/getGitRepository.d.ts +3 -3
  59. package/build/tools/getGitRepository.js +17 -2
  60. package/build/tools/getIssue.d.ts +3 -3
  61. package/build/tools/getIssue.js +32 -2
  62. package/build/tools/getIssueComments.d.ts +3 -3
  63. package/build/tools/getIssueComments.js +14 -2
  64. package/build/tools/getIssueTypes.d.ts +3 -3
  65. package/build/tools/getIssueTypes.js +11 -2
  66. package/build/tools/getIssues.d.ts +17 -17
  67. package/build/tools/getIssues.js +32 -2
  68. package/build/tools/getMyself.d.ts +3 -3
  69. package/build/tools/getMyself.js +11 -2
  70. package/build/tools/getNotifications.d.ts +3 -3
  71. package/build/tools/getNotifications.js +15 -2
  72. package/build/tools/getNotificationsCount.d.ts +3 -3
  73. package/build/tools/getNotificationsCount.js +5 -2
  74. package/build/tools/getPriorities.d.ts +3 -3
  75. package/build/tools/getPriorities.js +3 -2
  76. package/build/tools/getProject.d.ts +3 -3
  77. package/build/tools/getProject.js +22 -2
  78. package/build/tools/getProjectList.d.ts +3 -3
  79. package/build/tools/getProjectList.js +22 -2
  80. package/build/tools/getProjectUsers.d.ts +3 -3
  81. package/build/tools/getProjectUsers.js +11 -2
  82. package/build/tools/getPullRequest.d.ts +3 -3
  83. package/build/tools/getPullRequest.js +26 -2
  84. package/build/tools/getPullRequestComments.d.ts +3 -3
  85. package/build/tools/getPullRequestComments.js +12 -2
  86. package/build/tools/getPullRequests.d.ts +3 -3
  87. package/build/tools/getPullRequests.js +26 -2
  88. package/build/tools/getPullRequestsCount.d.ts +3 -3
  89. package/build/tools/getPullRequestsCount.js +5 -2
  90. package/build/tools/getRelatedIssues.d.ts +3 -3
  91. package/build/tools/getRelatedIssues.js +33 -2
  92. package/build/tools/getResolutions.d.ts +3 -3
  93. package/build/tools/getResolutions.js +3 -2
  94. package/build/tools/getSpace.d.ts +3 -3
  95. package/build/tools/getSpace.js +13 -2
  96. package/build/tools/getSpaceActivities.d.ts +3 -3
  97. package/build/tools/getSpaceActivities.js +12 -2
  98. package/build/tools/getUserRecentUpdates.d.ts +3 -3
  99. package/build/tools/getUserRecentUpdates.js +12 -2
  100. package/build/tools/getUserStarsCount.d.ts +3 -3
  101. package/build/tools/getUserStarsCount.js +3 -2
  102. package/build/tools/getUsers.d.ts +3 -3
  103. package/build/tools/getUsers.js +11 -2
  104. package/build/tools/getVersionMilestoneList.d.ts +3 -3
  105. package/build/tools/getVersionMilestoneList.js +12 -2
  106. package/build/tools/getWatchingListCount.d.ts +3 -3
  107. package/build/tools/getWatchingListCount.js +5 -2
  108. package/build/tools/getWatchingListItems.d.ts +3 -3
  109. package/build/tools/getWatchingListItems.js +12 -2
  110. package/build/tools/getWiki.d.ts +3 -3
  111. package/build/tools/getWiki.js +16 -2
  112. package/build/tools/getWikiPages.d.ts +3 -3
  113. package/build/tools/getWikiPages.js +12 -2
  114. package/build/tools/getWikisCount.d.ts +3 -3
  115. package/build/tools/getWikisCount.js +3 -2
  116. package/build/tools/markNotificationAsRead.d.ts +7 -2
  117. package/build/tools/markNotificationAsRead.js +6 -1
  118. package/build/tools/markWatchingAsRead.d.ts +7 -2
  119. package/build/tools/markWatchingAsRead.js +6 -1
  120. package/build/tools/removeRelatedIssue.d.ts +3 -3
  121. package/build/tools/removeRelatedIssue.js +33 -2
  122. package/build/tools/resetUnreadNotificationCount.d.ts +3 -3
  123. package/build/tools/resetUnreadNotificationCount.js +5 -2
  124. package/build/tools/shared/customFieldFiltersSchema.d.ts +1 -1
  125. package/build/tools/updateIssue.d.ts +3 -3
  126. package/build/tools/updateIssue.js +32 -2
  127. package/build/tools/updateIssueComment.d.ts +3 -3
  128. package/build/tools/updateIssueComment.js +14 -2
  129. package/build/tools/updateProject.d.ts +3 -3
  130. package/build/tools/updateProject.js +22 -2
  131. package/build/tools/updatePullRequest.d.ts +3 -3
  132. package/build/tools/updatePullRequest.js +26 -2
  133. package/build/tools/updatePullRequestComment.d.ts +3 -3
  134. package/build/tools/updatePullRequestComment.js +12 -2
  135. package/build/tools/updateVersionMilestone.d.ts +3 -3
  136. package/build/tools/updateVersionMilestone.js +12 -2
  137. package/build/tools/updateWatching.d.ts +3 -3
  138. package/build/tools/updateWatching.js +12 -2
  139. package/build/tools/updateWiki.d.ts +3 -3
  140. package/build/tools/updateWiki.js +16 -2
  141. package/build/types/outputFields.d.ts +26 -0
  142. package/build/types/outputFields.js +3 -0
  143. package/build/types/tool.d.ts +22 -9
  144. package/build/types/zod/activityType.d.ts +38 -0
  145. package/build/types/zod/activityType.js +38 -0
  146. package/build/utils/fieldSelection.d.ts +22 -0
  147. package/build/utils/fieldSelection.js +40 -0
  148. package/build/utils/logger.js +41 -3
  149. package/build/utils/resolveIdOrKey.d.ts +2 -2
  150. package/build/utils/toolsetUtils.d.ts +1 -3
  151. package/build/utils/toolsetUtils.js +0 -12
  152. package/package.json +17 -25
  153. package/build/tools/dynamicTools/toolsets.d.ts +0 -15
  154. package/build/tools/dynamicTools/toolsets.js +0 -103
  155. package/build/types/zod/backlogOutputDefinition.d.ts +0 -3334
  156. package/build/types/zod/backlogOutputDefinition.js +0 -483
  157. package/build/utils/generateFieldsDescription.d.ts +0 -5
  158. package/build/utils/generateFieldsDescription.js +0 -50
  159. package/build/utils/toolRegistrar.d.ts +0 -5
  160. package/build/utils/toolRegistrar.js +0 -12
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { WikiListItemSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  const getWikiPagesSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -21,7 +21,17 @@ export const getWikiPagesTool = (backlog, { t }) => {
21
21
  name: 'get_wiki_pages',
22
22
  description: t('TOOL_GET_WIKI_PAGES_DESCRIPTION', 'Returns list of Wiki pages'),
23
23
  schema: z.object(getWikiPagesSchema(t)),
24
- outputSchema: WikiListItemSchema,
24
+ returnsList: true,
25
+ outputFields: outputFields()([
26
+ 'id',
27
+ 'projectId',
28
+ 'name',
29
+ 'tags',
30
+ 'createdUser',
31
+ 'created',
32
+ 'updatedUser',
33
+ 'updated',
34
+ ]),
25
35
  importantFields: ['projectId', 'name', 'tags'],
26
36
  handler: async ({ projectId, projectKey, keyword }) => {
27
37
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
@@ -1,11 +1,11 @@
1
1
  import { z } from 'zod';
2
+ import type { Entity } from 'backlog-js';
2
3
  import { Backlog } from 'backlog-js';
3
4
  import { ToolDefinition } from '../types/tool.js';
4
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- import { WikiCountSchema } from '../types/zod/backlogOutputDefinition.js';
6
- declare const getWikisCountSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getWikisCountSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  };
10
- export declare const getWikisCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getWikisCountSchema>, (typeof WikiCountSchema)["shape"]>;
10
+ export declare const getWikisCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getWikisCountSchema>, Entity.Wiki.WikiCount>;
11
11
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { WikiCountSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  const getWikisCountSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -17,7 +17,8 @@ export const getWikisCountTool = (backlog, { t }) => {
17
17
  name: 'get_wikis_count',
18
18
  description: t('TOOL_GET_WIKIS_COUNT_DESCRIPTION', 'Returns count of wiki pages in a project'),
19
19
  schema: z.object(getWikisCountSchema(t)),
20
- outputSchema: WikiCountSchema,
20
+ returnsList: false,
21
+ outputFields: outputFields()(['count']),
21
22
  handler: async ({ projectId, projectKey }) => {
22
23
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
23
24
  if (!result.ok) {
@@ -1,13 +1,18 @@
1
1
  import { z } from 'zod';
2
2
  import { Backlog } from 'backlog-js';
3
3
  import { ToolDefinition } from '../types/tool.js';
4
+ /** This tool reports its own outcome; the Backlog call returns nothing. */
5
+ type MarkNotificationAsReadResult = {
6
+ success: boolean;
7
+ message: string;
8
+ };
4
9
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- declare const markNotificationAsReadSchema: (t: DescriptionHelper["t"]) => {
10
+ declare const markNotificationAsReadSchema: (t: DescriptionHelper['t']) => {
6
11
  id: z.ZodNumber;
7
12
  };
8
13
  export declare const MarkNotificationAsReadResultSchema: z.ZodObject<{
9
14
  success: z.ZodBoolean;
10
15
  message: z.ZodString;
11
16
  }, z.core.$strip>;
12
- export declare const markNotificationAsReadTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof markNotificationAsReadSchema>, (typeof MarkNotificationAsReadResultSchema)["shape"]>;
17
+ export declare const markNotificationAsReadTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof markNotificationAsReadSchema>, MarkNotificationAsReadResult>;
13
18
  export {};
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
+ import { outputFields } from '../types/outputFields.js';
3
4
  const markNotificationAsReadSchema = buildToolSchema((t) => ({
4
5
  id: z
5
6
  .number()
@@ -14,7 +15,11 @@ export const markNotificationAsReadTool = (backlog, { t }) => {
14
15
  name: 'mark_notification_as_read',
15
16
  description: t('TOOL_MARK_NOTIFICATION_AS_READ_DESCRIPTION', 'Mark a notification as read'),
16
17
  schema: z.object(markNotificationAsReadSchema(t)),
17
- outputSchema: MarkNotificationAsReadResultSchema,
18
+ returnsList: false,
19
+ outputFields: outputFields()([
20
+ 'success',
21
+ 'message',
22
+ ]),
18
23
  handler: async ({ id }) => {
19
24
  await backlog.markAsReadNotification(id);
20
25
  return {
@@ -1,13 +1,18 @@
1
1
  import { z } from 'zod';
2
2
  import { Backlog } from 'backlog-js';
3
3
  import { ToolDefinition } from '../types/tool.js';
4
+ /** This tool reports its own outcome; the Backlog call returns nothing. */
5
+ type MarkWatchingAsReadResult = {
6
+ success: boolean;
7
+ message: string;
8
+ };
4
9
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- declare const markWatchingAsReadSchema: (t: DescriptionHelper["t"]) => {
10
+ declare const markWatchingAsReadSchema: (t: DescriptionHelper['t']) => {
6
11
  watchId: z.ZodNumber;
7
12
  };
8
13
  export declare const MarkWatchingAsReadResultSchema: z.ZodObject<{
9
14
  success: z.ZodBoolean;
10
15
  message: z.ZodString;
11
16
  }, z.core.$strip>;
12
- export declare const markWatchingAsReadTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof markWatchingAsReadSchema>, (typeof MarkWatchingAsReadResultSchema)["shape"]>;
17
+ export declare const markWatchingAsReadTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof markWatchingAsReadSchema>, MarkWatchingAsReadResult>;
13
18
  export {};
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
+ import { outputFields } from '../types/outputFields.js';
3
4
  const markWatchingAsReadSchema = buildToolSchema((t) => ({
4
5
  watchId: z
5
6
  .number()
@@ -14,7 +15,11 @@ export const markWatchingAsReadTool = (backlog, { t }) => {
14
15
  name: 'mark_watching_as_read',
15
16
  description: t('TOOL_MARK_WATCHING_AS_READ_DESCRIPTION', 'Mark a watch as read'),
16
17
  schema: z.object(markWatchingAsReadSchema(t)),
17
- outputSchema: MarkWatchingAsReadResultSchema,
18
+ returnsList: false,
19
+ outputFields: outputFields()([
20
+ 'success',
21
+ 'message',
22
+ ]),
18
23
  handler: async ({ watchId }) => {
19
24
  await backlog.resetWatchingListItemAsRead(watchId);
20
25
  return {
@@ -1,12 +1,12 @@
1
1
  import { z } from 'zod';
2
+ import type { Entity } from 'backlog-js';
2
3
  import { Backlog } from 'backlog-js';
3
4
  import { ToolDefinition } from '../types/tool.js';
4
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- import { RelatedIssueSchema } from '../types/zod/backlogOutputDefinition.js';
6
- declare const removeRelatedIssueSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const removeRelatedIssueSchema: (t: DescriptionHelper['t']) => {
7
7
  issueId: z.ZodOptional<z.ZodNumber>;
8
8
  issueKey: z.ZodOptional<z.ZodString>;
9
9
  relatedIssueId: z.ZodNumber;
10
10
  };
11
- export declare const removeRelatedIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof removeRelatedIssueSchema>, (typeof RelatedIssueSchema)["shape"]>;
11
+ export declare const removeRelatedIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof removeRelatedIssueSchema>, Entity.Issue.RelatedIssue>;
12
12
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { RelatedIssueSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  const removeRelatedIssueSchema = buildToolSchema((t) => ({
6
6
  issueId: z
@@ -20,7 +20,38 @@ export const removeRelatedIssueTool = (backlog, { t }) => {
20
20
  name: 'remove_related_issue',
21
21
  description: t('TOOL_REMOVE_RELATED_ISSUE_DESCRIPTION', 'Removes the relation between an issue and a related issue'),
22
22
  schema: z.object(removeRelatedIssueSchema(t)),
23
- outputSchema: RelatedIssueSchema,
23
+ returnsList: false,
24
+ outputFields: outputFields()([
25
+ 'id',
26
+ 'projectId',
27
+ 'issueKey',
28
+ 'keyId',
29
+ 'issueType',
30
+ 'summary',
31
+ 'description',
32
+ 'resolution',
33
+ 'priority',
34
+ 'status',
35
+ 'assignee',
36
+ 'category',
37
+ 'versions',
38
+ 'milestone',
39
+ 'startDate',
40
+ 'dueDate',
41
+ 'estimatedHours',
42
+ 'actualHours',
43
+ 'parentIssueId',
44
+ 'createdUser',
45
+ 'created',
46
+ 'updatedUser',
47
+ 'updated',
48
+ 'customFields',
49
+ 'attachments',
50
+ 'sharedFiles',
51
+ 'stars',
52
+ 'childIssueSummary',
53
+ 'type',
54
+ ]),
24
55
  handler: async ({ issueId, issueKey, relatedIssueId }) => {
25
56
  const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
26
57
  if (!result.ok) {
@@ -1,7 +1,7 @@
1
+ import type { Entity } from 'backlog-js';
1
2
  import { Backlog } from 'backlog-js';
2
3
  import { ToolDefinition } from '../types/tool.js';
3
4
  import { DescriptionHelper } from '../createDescriptionHelper.js';
4
- import { NotificationCountSchema } from '../types/zod/backlogOutputDefinition.js';
5
- declare const resetUnreadNotificationCountSchema: (t: DescriptionHelper["t"]) => {};
6
- export declare const resetUnreadNotificationCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof resetUnreadNotificationCountSchema>, (typeof NotificationCountSchema)["shape"]>;
5
+ declare const resetUnreadNotificationCountSchema: (t: DescriptionHelper['t']) => {};
6
+ export declare const resetUnreadNotificationCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof resetUnreadNotificationCountSchema>, Entity.Notification.NotificationCount>;
7
7
  export {};
@@ -1,13 +1,16 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { NotificationCountSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  const resetUnreadNotificationCountSchema = buildToolSchema((_t) => ({}));
5
5
  export const resetUnreadNotificationCountTool = (backlog, { t }) => {
6
6
  return {
7
7
  name: 'reset_unread_notification_count',
8
8
  description: t('TOOL_RESET_UNREAD_NOTIFICATION_COUNT_DESCRIPTION', 'Reset unread notification count'),
9
9
  schema: z.object(resetUnreadNotificationCountSchema(t)),
10
- outputSchema: NotificationCountSchema,
10
+ returnsList: false,
11
+ outputFields: outputFields()([
12
+ 'count',
13
+ ]),
11
14
  handler: async () => backlog.resetNotificationsMarkAsRead(),
12
15
  };
13
16
  };
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { DescriptionHelper } from '../../createDescriptionHelper.js';
3
- export declare const buildCustomFieldFilterSchema: (t: DescriptionHelper["t"]) => z.ZodDiscriminatedUnion<[z.ZodObject<{
3
+ export declare const buildCustomFieldFilterSchema: (t: DescriptionHelper['t']) => z.ZodDiscriminatedUnion<[z.ZodObject<{
4
4
  type: z.ZodLiteral<"text">;
5
5
  id: z.ZodNumber;
6
6
  value: z.ZodString;
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import { Backlog } from 'backlog-js';
3
+ import type { Entity } from 'backlog-js';
3
4
  import { ToolDefinition } from '../types/tool.js';
4
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- import { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
6
- declare const updateIssueSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const updateIssueSchema: (t: DescriptionHelper['t']) => {
7
7
  issueId: z.ZodOptional<z.ZodNumber>;
8
8
  issueKey: z.ZodOptional<z.ZodString>;
9
9
  summary: z.ZodOptional<z.ZodString>;
@@ -30,5 +30,5 @@ declare const updateIssueSchema: (t: DescriptionHelper["t"]) => {
30
30
  otherValue: z.ZodOptional<z.ZodString>;
31
31
  }, z.core.$strip>>>;
32
32
  };
33
- export declare const updateIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updateIssueSchema>, (typeof IssueSchema)["shape"]>;
33
+ export declare const updateIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updateIssueSchema>, Entity.Issue.Issue>;
34
34
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  import { customFieldsToPayload } from '../backlog/customFields.js';
6
6
  const updateIssueSchema = buildToolSchema((t) => ({
@@ -135,7 +135,37 @@ export const updateIssueTool = (backlog, { t }) => {
135
135
  name: 'update_issue',
136
136
  description: t('TOOL_UPDATE_ISSUE_DESCRIPTION', 'Updates an existing issue'),
137
137
  schema: z.object(updateIssueSchema(t)),
138
- outputSchema: IssueSchema,
138
+ returnsList: false,
139
+ outputFields: outputFields()([
140
+ 'id',
141
+ 'projectId',
142
+ 'issueKey',
143
+ 'keyId',
144
+ 'issueType',
145
+ 'summary',
146
+ 'description',
147
+ 'resolution',
148
+ 'priority',
149
+ 'status',
150
+ 'assignee',
151
+ 'category',
152
+ 'versions',
153
+ 'milestone',
154
+ 'startDate',
155
+ 'dueDate',
156
+ 'estimatedHours',
157
+ 'actualHours',
158
+ 'parentIssueId',
159
+ 'createdUser',
160
+ 'created',
161
+ 'updatedUser',
162
+ 'updated',
163
+ 'customFields',
164
+ 'attachments',
165
+ 'sharedFiles',
166
+ 'stars',
167
+ 'childIssueSummary',
168
+ ]),
139
169
  handler: async ({ issueId, issueKey, customFields, ...params }) => {
140
170
  const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
141
171
  if (!result.ok) {
@@ -1,13 +1,13 @@
1
1
  import { z } from 'zod';
2
+ import type { Entity } from 'backlog-js';
2
3
  import { Backlog } from 'backlog-js';
3
4
  import { ToolDefinition } from '../types/tool.js';
4
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- import { IssueCommentSchema } from '../types/zod/backlogOutputDefinition.js';
6
- declare const updateIssueCommentSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const updateIssueCommentSchema: (t: DescriptionHelper['t']) => {
7
7
  issueId: z.ZodOptional<z.ZodNumber>;
8
8
  issueKey: z.ZodOptional<z.ZodString>;
9
9
  commentId: z.ZodNumber;
10
10
  content: z.ZodString;
11
11
  };
12
- export declare const updateIssueCommentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updateIssueCommentSchema>, (typeof IssueCommentSchema)["shape"]>;
12
+ export declare const updateIssueCommentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updateIssueCommentSchema>, Entity.Issue.Comment>;
13
13
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { IssueCommentSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  const updateIssueCommentSchema = buildToolSchema((t) => ({
6
6
  issueId: z
@@ -23,7 +23,19 @@ export const updateIssueCommentTool = (backlog, { t }) => {
23
23
  name: 'update_issue_comment',
24
24
  description: t('TOOL_UPDATE_ISSUE_COMMENT_DESCRIPTION', 'Updates a comment on an issue'),
25
25
  schema: z.object(updateIssueCommentSchema(t)),
26
- outputSchema: IssueCommentSchema,
26
+ returnsList: false,
27
+ outputFields: outputFields()([
28
+ 'id',
29
+ 'projectId',
30
+ 'issueId',
31
+ 'content',
32
+ 'changeLog',
33
+ 'createdUser',
34
+ 'created',
35
+ 'updated',
36
+ 'stars',
37
+ 'notifications',
38
+ ]),
27
39
  importantFields: ['id', 'content', 'createdUser', 'updated'],
28
40
  handler: async ({ issueId, issueKey, commentId, content }) => {
29
41
  const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
+ import type { Entity } from 'backlog-js';
2
3
  import { Backlog } from 'backlog-js';
3
4
  import { ToolDefinition } from '../types/tool.js';
4
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- import { ProjectSchema } from '../types/zod/backlogOutputDefinition.js';
6
- declare const updateProjectSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const updateProjectSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  name: z.ZodOptional<z.ZodString>;
@@ -17,5 +17,5 @@ declare const updateProjectSchema: (t: DescriptionHelper["t"]) => {
17
17
  }>>;
18
18
  archived: z.ZodOptional<z.ZodBoolean>;
19
19
  };
20
- export declare const updateProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updateProjectSchema>, (typeof ProjectSchema)["shape"]>;
20
+ export declare const updateProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updateProjectSchema>, Entity.Project.Project>;
21
21
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { ProjectSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  const updateProjectSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -45,7 +45,27 @@ export const updateProjectTool = (backlog, { t }) => {
45
45
  name: 'update_project',
46
46
  description: t('TOOL_UPDATE_PROJECT_DESCRIPTION', 'Updates an existing project'),
47
47
  schema: z.object(updateProjectSchema(t)),
48
- outputSchema: ProjectSchema,
48
+ returnsList: false,
49
+ outputFields: outputFields()([
50
+ 'id',
51
+ 'projectKey',
52
+ 'name',
53
+ 'chartEnabled',
54
+ 'useResolvedForChart',
55
+ 'subtaskingEnabled',
56
+ 'projectLeaderCanEditProjectLeader',
57
+ 'useWiki',
58
+ 'useFileSharing',
59
+ 'useWikiTreeView',
60
+ 'useOriginalImageSizeAtWiki',
61
+ 'useSubversion',
62
+ 'useGit',
63
+ 'textFormattingRule',
64
+ 'archived',
65
+ 'displayOrder',
66
+ 'useDevAttributes',
67
+ 'grandchildIssueEnabled',
68
+ ]),
49
69
  handler: async ({ projectId, projectKey, ...param }) => {
50
70
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
51
71
  if (!result.ok) {
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
+ import type { Entity } from 'backlog-js';
2
3
  import { Backlog } from 'backlog-js';
3
4
  import { ToolDefinition } from '../types/tool.js';
4
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- import { PullRequestSchema } from '../types/zod/backlogOutputDefinition.js';
6
- declare const updatePullRequestSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const updatePullRequestSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  repoId: z.ZodOptional<z.ZodNumber>;
@@ -16,5 +16,5 @@ declare const updatePullRequestSchema: (t: DescriptionHelper["t"]) => {
16
16
  notifiedUserId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
17
17
  statusId: z.ZodOptional<z.ZodNumber>;
18
18
  };
19
- export declare const updatePullRequestTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updatePullRequestSchema>, (typeof PullRequestSchema)["shape"]>;
19
+ export declare const updatePullRequestTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updatePullRequestSchema>, Entity.PullRequest.PullRequest>;
20
20
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { PullRequestSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  const updatePullRequestSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -52,7 +52,31 @@ export const updatePullRequestTool = (backlog, { t }) => {
52
52
  name: 'update_pull_request',
53
53
  description: t('TOOL_UPDATE_PULL_REQUEST_DESCRIPTION', 'Updates an existing pull request'),
54
54
  schema: z.object(updatePullRequestSchema(t)),
55
- outputSchema: PullRequestSchema,
55
+ returnsList: false,
56
+ outputFields: outputFields()([
57
+ 'id',
58
+ 'projectId',
59
+ 'repositoryId',
60
+ 'number',
61
+ 'summary',
62
+ 'description',
63
+ 'base',
64
+ 'branch',
65
+ 'status',
66
+ 'assignee',
67
+ 'issue',
68
+ 'baseCommit',
69
+ 'branchCommit',
70
+ 'mergeCommit',
71
+ 'closeAt',
72
+ 'mergeAt',
73
+ 'createdUser',
74
+ 'created',
75
+ 'updatedUser',
76
+ 'updated',
77
+ 'attachments',
78
+ 'stars',
79
+ ]),
56
80
  handler: async ({ projectId, projectKey, repoId, repoName, number, ...params }) => {
57
81
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
58
82
  if (!result.ok) {
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
+ import type { Entity } from 'backlog-js';
2
3
  import { Backlog } from 'backlog-js';
3
4
  import { ToolDefinition } from '../types/tool.js';
4
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- import { PullRequestCommentSchema } from '../types/zod/backlogOutputDefinition.js';
6
- declare const updatePullRequestCommentSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const updatePullRequestCommentSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  repoId: z.ZodOptional<z.ZodNumber>;
@@ -12,5 +12,5 @@ declare const updatePullRequestCommentSchema: (t: DescriptionHelper["t"]) => {
12
12
  commentId: z.ZodNumber;
13
13
  content: z.ZodString;
14
14
  };
15
- export declare const updatePullRequestCommentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updatePullRequestCommentSchema>, (typeof PullRequestCommentSchema)["shape"]>;
15
+ export declare const updatePullRequestCommentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updatePullRequestCommentSchema>, Entity.PullRequest.Comment>;
16
16
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { PullRequestCommentSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey, resolveIdOrName } from '../utils/resolveIdOrKey.js';
5
5
  const updatePullRequestCommentSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -34,7 +34,17 @@ export const updatePullRequestCommentTool = (backlog, { t }) => {
34
34
  name: 'update_pull_request_comment',
35
35
  description: t('TOOL_UPDATE_PULL_REQUEST_COMMENT_DESCRIPTION', 'Updates a comment on a pull request'),
36
36
  schema: z.object(updatePullRequestCommentSchema(t)),
37
- outputSchema: PullRequestCommentSchema,
37
+ returnsList: false,
38
+ outputFields: outputFields()([
39
+ 'id',
40
+ 'content',
41
+ 'changeLog',
42
+ 'createdUser',
43
+ 'created',
44
+ 'updated',
45
+ 'stars',
46
+ 'notifications',
47
+ ]),
38
48
  importantFields: ['id', 'content', 'createdUser', 'updated'],
39
49
  handler: async ({ projectId, projectKey, repoId, repoName, number, commentId, content, }) => {
40
50
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
+ import type { Entity } from 'backlog-js';
2
3
  import { Backlog } from 'backlog-js';
3
4
  import { ToolDefinition } from '../types/tool.js';
4
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- import { VersionSchema } from '../types/zod/backlogOutputDefinition.js';
6
- declare const updateVersionMilestoneSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const updateVersionMilestoneSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  id: z.ZodNumber;
@@ -13,5 +13,5 @@ declare const updateVersionMilestoneSchema: (t: DescriptionHelper["t"]) => {
13
13
  releaseDueDate: z.ZodOptional<z.ZodString>;
14
14
  archived: z.ZodOptional<z.ZodBoolean>;
15
15
  };
16
- export declare const updateVersionMilestoneTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updateVersionMilestoneSchema>, (typeof VersionSchema)["shape"]>;
16
+ export declare const updateVersionMilestoneTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updateVersionMilestoneSchema>, Entity.Project.Version>;
17
17
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { VersionSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  const updateVersionMilestoneSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -37,7 +37,17 @@ export const updateVersionMilestoneTool = (backlog, { t }) => {
37
37
  name: 'update_version_milestone',
38
38
  description: t('TOOL_UPDATE_VERSION_MILESTONE_DESCRIPTION', 'Updates an existing version milestone'),
39
39
  schema: z.object(updateVersionMilestoneSchema(t)),
40
- outputSchema: VersionSchema,
40
+ returnsList: false,
41
+ outputFields: outputFields()([
42
+ 'id',
43
+ 'projectId',
44
+ 'name',
45
+ 'description',
46
+ 'startDate',
47
+ 'releaseDueDate',
48
+ 'archived',
49
+ 'displayOrder',
50
+ ]),
41
51
  importantFields: [
42
52
  'id',
43
53
  'name',
@@ -1,11 +1,11 @@
1
1
  import { z } from 'zod';
2
+ import type { Entity } from 'backlog-js';
2
3
  import { Backlog } from 'backlog-js';
3
4
  import { ToolDefinition } from '../types/tool.js';
4
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- import { WatchingListItemSchema } from '../types/zod/backlogOutputDefinition.js';
6
- declare const updateWatchingSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const updateWatchingSchema: (t: DescriptionHelper['t']) => {
7
7
  watchId: z.ZodNumber;
8
8
  note: z.ZodString;
9
9
  };
10
- export declare const updateWatchingTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updateWatchingSchema>, (typeof WatchingListItemSchema)["shape"]>;
10
+ export declare const updateWatchingTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof updateWatchingSchema>, Entity.WatchingList.WatchingListItem>;
11
11
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { WatchingListItemSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  const updateWatchingSchema = buildToolSchema((t) => ({
5
5
  watchId: z.number().describe(t('TOOL_UPDATE_WATCHING_WATCH_ID', 'Watch ID')),
6
6
  note: z
@@ -12,7 +12,17 @@ export const updateWatchingTool = (backlog, { t }) => {
12
12
  name: 'update_watching',
13
13
  description: t('TOOL_UPDATE_WATCHING_DESCRIPTION', 'Updates an existing watch note'),
14
14
  schema: z.object(updateWatchingSchema(t)),
15
- outputSchema: WatchingListItemSchema,
15
+ returnsList: false,
16
+ outputFields: outputFields()([
17
+ 'id',
18
+ 'resourceAlreadyRead',
19
+ 'note',
20
+ 'type',
21
+ 'issue',
22
+ 'lastContentUpdated',
23
+ 'created',
24
+ 'updated',
25
+ ]),
16
26
  handler: async ({ watchId, note }) => backlog.patchWatchingListItem(watchId, note),
17
27
  };
18
28
  };