backlog-mcp-server 0.16.0 → 0.18.0

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 (157) hide show
  1. package/README.ja.md +15 -32
  2. package/README.md +20 -32
  3. package/build/auth/oauthRoutes.js +53 -1
  4. package/build/createBacklogMcpServer.d.ts +4 -6
  5. package/build/createBacklogMcpServer.js +4 -12
  6. package/build/handlers/builders/composeToolHandler.d.ts +1 -1
  7. package/build/handlers/builders/composeToolHandler.js +15 -9
  8. package/build/handlers/transformers/wrapWithFieldPicking.d.ts +14 -1
  9. package/build/handlers/transformers/wrapWithFieldPicking.js +30 -36
  10. package/build/index.js +30 -16
  11. package/build/lib.d.ts +1 -1
  12. package/build/loadDescriptionOverrides.d.ts +0 -13
  13. package/build/loadDescriptionOverrides.js +73 -11
  14. package/build/reportUnknownOverrideKeys.d.ts +22 -0
  15. package/build/reportUnknownOverrideKeys.js +42 -0
  16. package/build/tools/addDocument.d.ts +2 -2
  17. package/build/tools/addDocument.js +17 -2
  18. package/build/tools/addIssue.d.ts +2 -2
  19. package/build/tools/addIssue.js +32 -2
  20. package/build/tools/addIssueComment.d.ts +2 -2
  21. package/build/tools/addIssueComment.js +14 -2
  22. package/build/tools/addProject.d.ts +2 -2
  23. package/build/tools/addProject.js +22 -2
  24. package/build/tools/addPullRequest.d.ts +2 -2
  25. package/build/tools/addPullRequest.js +26 -2
  26. package/build/tools/addPullRequestComment.d.ts +2 -2
  27. package/build/tools/addPullRequestComment.js +12 -2
  28. package/build/tools/addRelatedIssue.d.ts +2 -2
  29. package/build/tools/addRelatedIssue.js +33 -2
  30. package/build/tools/addVersionMilestone.d.ts +2 -2
  31. package/build/tools/addVersionMilestone.js +12 -2
  32. package/build/tools/addWatching.d.ts +2 -2
  33. package/build/tools/addWatching.js +12 -2
  34. package/build/tools/addWiki.d.ts +2 -2
  35. package/build/tools/addWiki.js +16 -2
  36. package/build/tools/countIssues.d.ts +2 -2
  37. package/build/tools/countIssues.js +3 -2
  38. package/build/tools/deleteIssue.d.ts +2 -2
  39. package/build/tools/deleteIssue.js +32 -2
  40. package/build/tools/deleteProject.d.ts +2 -2
  41. package/build/tools/deleteProject.js +22 -2
  42. package/build/tools/deleteVersion.d.ts +2 -2
  43. package/build/tools/deleteVersion.js +12 -2
  44. package/build/tools/deleteWatching.d.ts +2 -2
  45. package/build/tools/deleteWatching.js +12 -2
  46. package/build/tools/getCategories.d.ts +2 -2
  47. package/build/tools/getCategories.js +8 -2
  48. package/build/tools/getCustomFields.d.ts +2 -2
  49. package/build/tools/getCustomFields.js +22 -2
  50. package/build/tools/getDocument.d.ts +2 -2
  51. package/build/tools/getDocument.js +17 -2
  52. package/build/tools/getDocumentTree.d.ts +2 -2
  53. package/build/tools/getDocumentTree.js +7 -2
  54. package/build/tools/getDocuments.d.ts +2 -2
  55. package/build/tools/getDocuments.js +17 -2
  56. package/build/tools/getGitRepositories.d.ts +2 -2
  57. package/build/tools/getGitRepositories.js +17 -2
  58. package/build/tools/getGitRepository.d.ts +2 -2
  59. package/build/tools/getGitRepository.js +17 -2
  60. package/build/tools/getIssue.d.ts +2 -2
  61. package/build/tools/getIssue.js +32 -2
  62. package/build/tools/getIssueComments.d.ts +2 -2
  63. package/build/tools/getIssueComments.js +14 -2
  64. package/build/tools/getIssueTypes.d.ts +2 -2
  65. package/build/tools/getIssueTypes.js +11 -2
  66. package/build/tools/getIssues.d.ts +10 -10
  67. package/build/tools/getIssues.js +32 -2
  68. package/build/tools/getMyself.d.ts +2 -2
  69. package/build/tools/getMyself.js +11 -2
  70. package/build/tools/getNotifications.d.ts +2 -2
  71. package/build/tools/getNotifications.js +15 -2
  72. package/build/tools/getNotificationsCount.d.ts +2 -2
  73. package/build/tools/getNotificationsCount.js +5 -2
  74. package/build/tools/getPriorities.d.ts +2 -2
  75. package/build/tools/getPriorities.js +3 -2
  76. package/build/tools/getProject.d.ts +2 -2
  77. package/build/tools/getProject.js +22 -2
  78. package/build/tools/getProjectList.d.ts +2 -2
  79. package/build/tools/getProjectList.js +22 -2
  80. package/build/tools/getProjectUsers.d.ts +2 -2
  81. package/build/tools/getProjectUsers.js +11 -2
  82. package/build/tools/getPullRequest.d.ts +2 -2
  83. package/build/tools/getPullRequest.js +26 -2
  84. package/build/tools/getPullRequestComments.d.ts +2 -2
  85. package/build/tools/getPullRequestComments.js +12 -2
  86. package/build/tools/getPullRequests.d.ts +2 -2
  87. package/build/tools/getPullRequests.js +26 -2
  88. package/build/tools/getPullRequestsCount.d.ts +2 -2
  89. package/build/tools/getPullRequestsCount.js +5 -2
  90. package/build/tools/getRelatedIssues.d.ts +2 -2
  91. package/build/tools/getRelatedIssues.js +33 -2
  92. package/build/tools/getResolutions.d.ts +2 -2
  93. package/build/tools/getResolutions.js +3 -2
  94. package/build/tools/getSpace.d.ts +2 -2
  95. package/build/tools/getSpace.js +13 -2
  96. package/build/tools/getSpaceActivities.d.ts +2 -2
  97. package/build/tools/getSpaceActivities.js +12 -2
  98. package/build/tools/getUserRecentUpdates.d.ts +2 -2
  99. package/build/tools/getUserRecentUpdates.js +12 -2
  100. package/build/tools/getUserStarsCount.d.ts +2 -2
  101. package/build/tools/getUserStarsCount.js +3 -2
  102. package/build/tools/getUsers.d.ts +2 -2
  103. package/build/tools/getUsers.js +11 -2
  104. package/build/tools/getVersionMilestoneList.d.ts +2 -2
  105. package/build/tools/getVersionMilestoneList.js +12 -2
  106. package/build/tools/getWatchingListCount.d.ts +2 -2
  107. package/build/tools/getWatchingListCount.js +5 -2
  108. package/build/tools/getWatchingListItems.d.ts +2 -2
  109. package/build/tools/getWatchingListItems.js +12 -2
  110. package/build/tools/getWiki.d.ts +2 -2
  111. package/build/tools/getWiki.js +16 -2
  112. package/build/tools/getWikiPages.d.ts +2 -2
  113. package/build/tools/getWikiPages.js +12 -2
  114. package/build/tools/getWikisCount.d.ts +2 -2
  115. package/build/tools/getWikisCount.js +3 -2
  116. package/build/tools/markNotificationAsRead.d.ts +6 -1
  117. package/build/tools/markNotificationAsRead.js +6 -1
  118. package/build/tools/markWatchingAsRead.d.ts +6 -1
  119. package/build/tools/markWatchingAsRead.js +6 -1
  120. package/build/tools/removeRelatedIssue.d.ts +2 -2
  121. package/build/tools/removeRelatedIssue.js +33 -2
  122. package/build/tools/resetUnreadNotificationCount.d.ts +2 -2
  123. package/build/tools/resetUnreadNotificationCount.js +5 -2
  124. package/build/tools/updateIssue.d.ts +2 -2
  125. package/build/tools/updateIssue.js +32 -2
  126. package/build/tools/updateIssueComment.d.ts +2 -2
  127. package/build/tools/updateIssueComment.js +14 -2
  128. package/build/tools/updateProject.d.ts +2 -2
  129. package/build/tools/updateProject.js +22 -2
  130. package/build/tools/updatePullRequest.d.ts +2 -2
  131. package/build/tools/updatePullRequest.js +26 -2
  132. package/build/tools/updatePullRequestComment.d.ts +2 -2
  133. package/build/tools/updatePullRequestComment.js +12 -2
  134. package/build/tools/updateVersionMilestone.d.ts +2 -2
  135. package/build/tools/updateVersionMilestone.js +12 -2
  136. package/build/tools/updateWatching.d.ts +2 -2
  137. package/build/tools/updateWatching.js +12 -2
  138. package/build/tools/updateWiki.d.ts +2 -2
  139. package/build/tools/updateWiki.js +16 -2
  140. package/build/types/outputFields.d.ts +26 -0
  141. package/build/types/outputFields.js +3 -0
  142. package/build/types/tool.d.ts +21 -8
  143. package/build/types/zod/activityType.d.ts +38 -0
  144. package/build/types/zod/activityType.js +38 -0
  145. package/build/utils/fieldSelection.d.ts +22 -0
  146. package/build/utils/fieldSelection.js +40 -0
  147. package/build/utils/toolsetUtils.d.ts +1 -3
  148. package/build/utils/toolsetUtils.js +0 -12
  149. package/package.json +4 -4
  150. package/build/tools/dynamicTools/toolsets.d.ts +0 -15
  151. package/build/tools/dynamicTools/toolsets.js +0 -103
  152. package/build/types/zod/backlogOutputDefinition.d.ts +0 -3334
  153. package/build/types/zod/backlogOutputDefinition.js +0 -483
  154. package/build/utils/generateFieldsDescription.d.ts +0 -5
  155. package/build/utils/generateFieldsDescription.js +0 -50
  156. package/build/utils/toolRegistrar.d.ts +0 -5
  157. 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 { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  const getIssueSchema = buildToolSchema((t) => ({
6
6
  issueId: z
@@ -16,7 +16,37 @@ export const getIssueTool = (backlog, { t }) => {
16
16
  return {
17
17
  name: 'get_issue',
18
18
  description: t('TOOL_GET_ISSUE_DESCRIPTION', 'Returns information about a specific issue'),
19
- outputSchema: IssueSchema,
19
+ returnsList: false,
20
+ outputFields: outputFields()([
21
+ 'id',
22
+ 'projectId',
23
+ 'issueKey',
24
+ 'keyId',
25
+ 'issueType',
26
+ 'summary',
27
+ 'description',
28
+ 'resolution',
29
+ 'priority',
30
+ 'status',
31
+ 'assignee',
32
+ 'category',
33
+ 'versions',
34
+ 'milestone',
35
+ 'startDate',
36
+ 'dueDate',
37
+ 'estimatedHours',
38
+ 'actualHours',
39
+ 'parentIssueId',
40
+ 'createdUser',
41
+ 'created',
42
+ 'updatedUser',
43
+ 'updated',
44
+ 'customFields',
45
+ 'attachments',
46
+ 'sharedFiles',
47
+ 'stars',
48
+ 'childIssueSummary',
49
+ ]),
20
50
  schema: z.object(getIssueSchema(t)),
21
51
  handler: async ({ issueId, issueKey }) => {
22
52
  const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
@@ -1,8 +1,8 @@
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
6
  declare const getIssueCommentsSchema: (t: DescriptionHelper["t"]) => {
7
7
  issueId: z.ZodOptional<z.ZodNumber>;
8
8
  issueKey: z.ZodOptional<z.ZodString>;
@@ -14,5 +14,5 @@ declare const getIssueCommentsSchema: (t: DescriptionHelper["t"]) => {
14
14
  desc: "desc";
15
15
  }>>;
16
16
  };
17
- export declare const getIssueCommentsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssueCommentsSchema>, (typeof IssueCommentSchema)["shape"]>;
17
+ export declare const getIssueCommentsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssueCommentsSchema>, Entity.Issue.Comment>;
18
18
  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 getIssueCommentsSchema = buildToolSchema((t) => ({
6
6
  issueId: z
@@ -33,7 +33,19 @@ export const getIssueCommentsTool = (backlog, { t }) => {
33
33
  name: 'get_issue_comments',
34
34
  description: t('TOOL_GET_ISSUE_COMMENTS_DESCRIPTION', 'Returns list of comments for an issue'),
35
35
  schema: z.object(getIssueCommentsSchema(t)),
36
- outputSchema: IssueCommentSchema,
36
+ returnsList: true,
37
+ outputFields: outputFields()([
38
+ 'id',
39
+ 'projectId',
40
+ 'issueId',
41
+ 'content',
42
+ 'changeLog',
43
+ 'createdUser',
44
+ 'created',
45
+ 'updated',
46
+ 'stars',
47
+ 'notifications',
48
+ ]),
37
49
  handler: async ({ issueId, issueKey, ...params }) => {
38
50
  const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
39
51
  if (!result.ok) {
@@ -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 { IssueTypeSchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const getIssueTypesSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  };
10
- export declare const getIssueTypesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssueTypesSchema>, (typeof IssueTypeSchema)["shape"]>;
10
+ export declare const getIssueTypesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssueTypesSchema>, Entity.Issue.IssueType>;
11
11
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { IssueTypeSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  const getIssueTypesSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -17,7 +17,16 @@ export const getIssueTypesTool = (backlog, { t }) => {
17
17
  name: 'get_issue_types',
18
18
  description: t('TOOL_GET_ISSUE_TYPES_DESCRIPTION', 'Returns list of issue types for a project'),
19
19
  schema: z.object(getIssueTypesSchema(t)),
20
- outputSchema: IssueTypeSchema,
20
+ returnsList: true,
21
+ outputFields: outputFields()([
22
+ 'id',
23
+ 'projectId',
24
+ 'name',
25
+ 'color',
26
+ 'displayOrder',
27
+ 'templateSummary',
28
+ 'templateDescription',
29
+ ]),
21
30
  importantFields: ['id', 'name'],
22
31
  handler: async ({ projectId, projectKey }) => {
23
32
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
@@ -1,8 +1,8 @@
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 { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const getIssuesSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
8
8
  issueTypeId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
@@ -27,20 +27,20 @@ declare const getIssuesSchema: (t: DescriptionHelper["t"]) => {
27
27
  sort: z.ZodOptional<z.ZodEnum<{
28
28
  version: "version";
29
29
  priority: "priority";
30
- createdUser: "createdUser";
31
- created: "created";
30
+ summary: "summary";
32
31
  startDate: "startDate";
33
- updatedUser: "updatedUser";
34
- updated: "updated";
32
+ dueDate: "dueDate";
33
+ estimatedHours: "estimatedHours";
34
+ actualHours: "actualHours";
35
35
  issueType: "issueType";
36
36
  status: "status";
37
- summary: "summary";
38
37
  assignee: "assignee";
39
38
  category: "category";
40
39
  milestone: "milestone";
41
- dueDate: "dueDate";
42
- estimatedHours: "estimatedHours";
43
- actualHours: "actualHours";
40
+ createdUser: "createdUser";
41
+ created: "created";
42
+ updatedUser: "updatedUser";
43
+ updated: "updated";
44
44
  attachment: "attachment";
45
45
  sharedFile: "sharedFile";
46
46
  childIssue: "childIssue";
@@ -71,5 +71,5 @@ declare const getIssuesSchema: (t: DescriptionHelper["t"]) => {
71
71
  value: z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>;
72
72
  }, z.core.$strip>], "type">>>;
73
73
  };
74
- export declare const getIssuesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssuesSchema>, (typeof IssueSchema)["shape"]>;
74
+ export declare const getIssuesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssuesSchema>, Entity.Issue.Issue>;
75
75
  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 { customFieldFiltersToPayload } from '../backlog/customFields.js';
5
5
  import { buildCustomFieldFilterSchema } from './shared/customFieldFiltersSchema.js';
6
6
  const getIssuesSchema = buildToolSchema((t) => ({
@@ -138,7 +138,37 @@ export const getIssuesTool = (backlog, { t }) => {
138
138
  'description',
139
139
  'issueType',
140
140
  ],
141
- outputSchema: IssueSchema,
141
+ returnsList: true,
142
+ outputFields: outputFields()([
143
+ 'id',
144
+ 'projectId',
145
+ 'issueKey',
146
+ 'keyId',
147
+ 'issueType',
148
+ 'summary',
149
+ 'description',
150
+ 'resolution',
151
+ 'priority',
152
+ 'status',
153
+ 'assignee',
154
+ 'category',
155
+ 'versions',
156
+ 'milestone',
157
+ 'startDate',
158
+ 'dueDate',
159
+ 'estimatedHours',
160
+ 'actualHours',
161
+ 'parentIssueId',
162
+ 'createdUser',
163
+ 'created',
164
+ 'updatedUser',
165
+ 'updated',
166
+ 'customFields',
167
+ 'attachments',
168
+ 'sharedFiles',
169
+ 'stars',
170
+ 'childIssueSummary',
171
+ ]),
142
172
  handler: async ({ customFields, ...rest }) => {
143
173
  return backlog.getIssues({
144
174
  ...rest,
@@ -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 { UserSchema } from '../types/zod/backlogOutputDefinition.js';
5
5
  declare const getMyselfSchema: (t: DescriptionHelper["t"]) => {};
6
- export declare const getMyselfTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getMyselfSchema>, (typeof UserSchema)["shape"]>;
6
+ export declare const getMyselfTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getMyselfSchema>, Entity.User.User>;
7
7
  export {};
@@ -1,13 +1,22 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { UserSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  const getMyselfSchema = buildToolSchema((_t) => ({}));
5
5
  export const getMyselfTool = (backlog, { t }) => {
6
6
  return {
7
7
  name: 'get_myself',
8
8
  description: t('TOOL_GET_MYSELF_DESCRIPTION', 'Returns information about the authenticated user'),
9
9
  schema: z.object(getMyselfSchema(t)),
10
- outputSchema: UserSchema,
10
+ returnsList: false,
11
+ outputFields: outputFields()([
12
+ 'id',
13
+ 'userId',
14
+ 'name',
15
+ 'roleType',
16
+ 'lang',
17
+ 'mailAddress',
18
+ 'lastLoginTime',
19
+ ]),
11
20
  importantFields: ['id', 'userId', 'name', 'roleType'],
12
21
  handler: async () => backlog.getMyself(),
13
22
  };
@@ -1,8 +1,8 @@
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 { NotificationSchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const getNotificationsSchema: (t: DescriptionHelper["t"]) => {
7
7
  minId: z.ZodOptional<z.ZodNumber>;
8
8
  maxId: z.ZodOptional<z.ZodNumber>;
@@ -12,5 +12,5 @@ declare const getNotificationsSchema: (t: DescriptionHelper["t"]) => {
12
12
  desc: "desc";
13
13
  }>>;
14
14
  };
15
- export declare const getNotificationsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getNotificationsSchema>, (typeof NotificationSchema)["shape"]>;
15
+ export declare const getNotificationsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getNotificationsSchema>, Entity.Notification.Notification>;
16
16
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { NotificationSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  const getNotificationsSchema = buildToolSchema((t) => ({
5
5
  minId: z
6
6
  .number()
@@ -24,7 +24,20 @@ export const getNotificationsTool = (backlog, { t }) => {
24
24
  name: 'get_notifications',
25
25
  description: t('TOOL_GET_NOTIFICATIONS_DESCRIPTION', 'Returns list of notifications'),
26
26
  schema: z.object(getNotificationsSchema(t)),
27
- outputSchema: NotificationSchema,
27
+ returnsList: true,
28
+ outputFields: outputFields()([
29
+ 'id',
30
+ 'alreadyRead',
31
+ 'reason',
32
+ 'resourceAlreadyRead',
33
+ 'project',
34
+ 'issue',
35
+ 'comment',
36
+ 'pullRequest',
37
+ 'pullRequestComment',
38
+ 'sender',
39
+ 'created',
40
+ ]),
28
41
  handler: async ({ minId, maxId, count, order }) => backlog.getNotifications({
29
42
  minId,
30
43
  maxId,
@@ -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 { NotificationCountSchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const getNotificationsCountSchema: (t: DescriptionHelper["t"]) => {
7
7
  alreadyRead: z.ZodBoolean;
8
8
  resourceAlreadyRead: z.ZodBoolean;
9
9
  };
10
- export declare const getNotificationsCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getNotificationsCountSchema>, (typeof NotificationCountSchema)["shape"]>;
10
+ export declare const getNotificationsCountTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getNotificationsCountSchema>, Entity.Notification.NotificationCount>;
11
11
  export {};
@@ -1,6 +1,6 @@
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 getNotificationsCountSchema = buildToolSchema((t) => ({
5
5
  alreadyRead: z
6
6
  .boolean()
@@ -14,7 +14,10 @@ export const getNotificationsCountTool = (backlog, { t }) => {
14
14
  name: 'count_notifications',
15
15
  description: t('TOOL_COUNT_NOTIFICATIONS_DESCRIPTION', 'Returns count of notifications'),
16
16
  schema: z.object(getNotificationsCountSchema(t)),
17
- outputSchema: NotificationCountSchema,
17
+ returnsList: false,
18
+ outputFields: outputFields()([
19
+ 'count',
20
+ ]),
18
21
  handler: async (params) => backlog.getNotificationsCount(params),
19
22
  };
20
23
  };
@@ -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 { PrioritySchema } from '../types/zod/backlogOutputDefinition.js';
5
5
  declare const getPrioritiesSchema: (t: DescriptionHelper["t"]) => {};
6
- export declare const getPrioritiesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getPrioritiesSchema>, (typeof PrioritySchema)["shape"]>;
6
+ export declare const getPrioritiesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getPrioritiesSchema>, Entity.Issue.Priority>;
7
7
  export {};
@@ -1,13 +1,14 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { PrioritySchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  const getPrioritiesSchema = buildToolSchema((_t) => ({}));
5
5
  export const getPrioritiesTool = (backlog, { t }) => {
6
6
  return {
7
7
  name: 'get_priorities',
8
8
  description: t('TOOL_GET_PRIORITIES_DESCRIPTION', 'Returns list of priorities'),
9
9
  schema: z.object(getPrioritiesSchema(t)),
10
- outputSchema: PrioritySchema,
10
+ returnsList: true,
11
+ outputFields: outputFields()(['id', 'name']),
11
12
  handler: async () => backlog.getPriorities(),
12
13
  };
13
14
  };
@@ -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 { ProjectSchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const getProjectSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  };
10
- export declare const getProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getProjectSchema>, (typeof ProjectSchema)["shape"]>;
10
+ export declare const getProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getProjectSchema>, Entity.Project.Project>;
11
11
  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 getProjectSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -17,7 +17,27 @@ export const getProjectTool = (backlog, { t }) => {
17
17
  name: 'get_project',
18
18
  description: t('TOOL_GET_PROJECT_DESCRIPTION', 'Returns information about a specific project'),
19
19
  schema: z.object(getProjectSchema(t)),
20
- outputSchema: ProjectSchema,
20
+ returnsList: false,
21
+ outputFields: outputFields()([
22
+ 'id',
23
+ 'projectKey',
24
+ 'name',
25
+ 'chartEnabled',
26
+ 'useResolvedForChart',
27
+ 'subtaskingEnabled',
28
+ 'projectLeaderCanEditProjectLeader',
29
+ 'useWiki',
30
+ 'useFileSharing',
31
+ 'useWikiTreeView',
32
+ 'useOriginalImageSizeAtWiki',
33
+ 'useSubversion',
34
+ 'useGit',
35
+ 'textFormattingRule',
36
+ 'archived',
37
+ 'displayOrder',
38
+ 'useDevAttributes',
39
+ 'grandchildIssueEnabled',
40
+ ]),
21
41
  handler: async ({ projectId, projectKey }) => {
22
42
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
23
43
  if (!result.ok) {
@@ -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 { ProjectSchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const getProjectListSchema: (t: DescriptionHelper["t"]) => {
7
7
  archived: z.ZodOptional<z.ZodBoolean>;
8
8
  all: z.ZodOptional<z.ZodBoolean>;
9
9
  };
10
- export declare const getProjectListTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getProjectListSchema>, (typeof ProjectSchema)["shape"]>;
10
+ export declare const getProjectListTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getProjectListSchema>, Entity.Project.Project>;
11
11
  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
  const getProjectListSchema = buildToolSchema((t) => ({
5
5
  archived: z
6
6
  .boolean()
@@ -16,7 +16,27 @@ export const getProjectListTool = (backlog, { t }) => {
16
16
  name: 'get_project_list',
17
17
  description: t('TOOL_GET_PROJECT_LIST_DESCRIPTION', 'Returns list of projects'),
18
18
  schema: z.object(getProjectListSchema(t)),
19
- outputSchema: ProjectSchema,
19
+ returnsList: true,
20
+ outputFields: outputFields()([
21
+ 'id',
22
+ 'projectKey',
23
+ 'name',
24
+ 'chartEnabled',
25
+ 'useResolvedForChart',
26
+ 'subtaskingEnabled',
27
+ 'projectLeaderCanEditProjectLeader',
28
+ 'useWiki',
29
+ 'useFileSharing',
30
+ 'useWikiTreeView',
31
+ 'useOriginalImageSizeAtWiki',
32
+ 'useSubversion',
33
+ 'useGit',
34
+ 'textFormattingRule',
35
+ 'archived',
36
+ 'displayOrder',
37
+ 'useDevAttributes',
38
+ 'grandchildIssueEnabled',
39
+ ]),
20
40
  importantFields: ['id', 'projectKey', 'name'],
21
41
  handler: async ({ archived, all }) => backlog.getProjects({ archived, all }),
22
42
  };
@@ -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 { UserSchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const getProjectUsersSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  };
10
- export declare const getProjectUsersTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getProjectUsersSchema>, (typeof UserSchema)["shape"]>;
10
+ export declare const getProjectUsersTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getProjectUsersSchema>, Entity.User.User>;
11
11
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { UserSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  const getProjectUsersSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -17,7 +17,16 @@ export const getProjectUsersTool = (backlog, { t }) => {
17
17
  name: 'get_project_users',
18
18
  description: t('TOOL_GET_PROJECT_USERS_DESCRIPTION', 'Returns list of users in a specific project'),
19
19
  schema: z.object(getProjectUsersSchema(t)),
20
- outputSchema: UserSchema,
20
+ returnsList: true,
21
+ outputFields: outputFields()([
22
+ 'id',
23
+ 'userId',
24
+ 'name',
25
+ 'roleType',
26
+ 'lang',
27
+ 'mailAddress',
28
+ 'lastLoginTime',
29
+ ]),
21
30
  importantFields: ['userId', 'name', 'roleType', 'lang'],
22
31
  handler: async ({ projectId, projectKey }) => {
23
32
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
@@ -1,8 +1,8 @@
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
6
  declare const getPullRequestSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
@@ -10,5 +10,5 @@ declare const getPullRequestSchema: (t: DescriptionHelper["t"]) => {
10
10
  repoName: z.ZodOptional<z.ZodString>;
11
11
  number: z.ZodNumber;
12
12
  };
13
- export declare const getPullRequestTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getPullRequestSchema>, (typeof PullRequestSchema)["shape"]>;
13
+ export declare const getPullRequestTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getPullRequestSchema>, Entity.PullRequest.PullRequest>;
14
14
  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, resolveIdOrName } from '../utils/resolveIdOrKey.js';
5
5
  const getPullRequestSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -28,7 +28,31 @@ export const getPullRequestTool = (backlog, { t }) => {
28
28
  name: 'get_pull_request',
29
29
  description: t('TOOL_GET_PULL_REQUEST_DESCRIPTION', 'Returns information about a specific pull request'),
30
30
  schema: z.object(getPullRequestSchema(t)),
31
- outputSchema: PullRequestSchema,
31
+ returnsList: false,
32
+ outputFields: outputFields()([
33
+ 'id',
34
+ 'projectId',
35
+ 'repositoryId',
36
+ 'number',
37
+ 'summary',
38
+ 'description',
39
+ 'base',
40
+ 'branch',
41
+ 'status',
42
+ 'assignee',
43
+ 'issue',
44
+ 'baseCommit',
45
+ 'branchCommit',
46
+ 'mergeCommit',
47
+ 'closeAt',
48
+ 'mergeAt',
49
+ 'createdUser',
50
+ 'created',
51
+ 'updatedUser',
52
+ 'updated',
53
+ 'attachments',
54
+ 'stars',
55
+ ]),
32
56
  handler: async ({ projectId, projectKey, repoId, repoName, number }) => {
33
57
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
34
58
  if (!result.ok) {
@@ -1,8 +1,8 @@
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
6
  declare const getPullRequestCommentsSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
@@ -17,5 +17,5 @@ declare const getPullRequestCommentsSchema: (t: DescriptionHelper["t"]) => {
17
17
  desc: "desc";
18
18
  }>>;
19
19
  };
20
- export declare const getPullRequestCommentsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getPullRequestCommentsSchema>, (typeof PullRequestCommentSchema)["shape"]>;
20
+ export declare const getPullRequestCommentsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getPullRequestCommentsSchema>, Entity.PullRequest.Comment>;
21
21
  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 getPullRequestCommentsSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -44,7 +44,17 @@ export const getPullRequestCommentsTool = (backlog, { t }) => {
44
44
  name: 'get_pull_request_comments',
45
45
  description: t('TOOL_GET_PULL_REQUEST_COMMENTS_DESCRIPTION', 'Returns list of comments for a pull request'),
46
46
  schema: z.object(getPullRequestCommentsSchema(t)),
47
- outputSchema: PullRequestCommentSchema,
47
+ returnsList: true,
48
+ outputFields: outputFields()([
49
+ 'id',
50
+ 'content',
51
+ 'changeLog',
52
+ 'createdUser',
53
+ 'created',
54
+ 'updated',
55
+ 'stars',
56
+ 'notifications',
57
+ ]),
48
58
  handler: async ({ projectId, projectKey, repoId, repoName, number, ...params }) => {
49
59
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
50
60
  if (!result.ok) {