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,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 { WikiSchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const addWikiSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodNumber;
8
8
  name: z.ZodString;
9
9
  content: z.ZodString;
10
10
  mailNotify: z.ZodOptional<z.ZodBoolean>;
11
11
  };
12
- export declare const addWikiTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addWikiSchema>, (typeof WikiSchema)["shape"]>;
12
+ export declare const addWikiTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addWikiSchema>, Entity.Wiki.Wiki>;
13
13
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { WikiSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  const addWikiSchema = buildToolSchema((t) => ({
5
5
  projectId: z.number().describe(t('TOOL_ADD_WIKI_PROJECT_ID', 'Project ID')),
6
6
  name: z.string().describe(t('TOOL_ADD_WIKI_NAME', 'Name of the wiki page')),
@@ -17,7 +17,21 @@ export const addWikiTool = (backlog, { t }) => {
17
17
  name: 'add_wiki',
18
18
  description: t('TOOL_ADD_WIKI_DESCRIPTION', 'Creates a new wiki page'),
19
19
  schema: z.object(addWikiSchema(t)),
20
- outputSchema: WikiSchema,
20
+ returnsList: false,
21
+ outputFields: outputFields()([
22
+ 'id',
23
+ 'projectId',
24
+ 'name',
25
+ 'content',
26
+ 'tags',
27
+ 'attachments',
28
+ 'sharedFiles',
29
+ 'stars',
30
+ 'createdUser',
31
+ 'created',
32
+ 'updatedUser',
33
+ 'updated',
34
+ ]),
21
35
  importantFields: ['id', 'name', 'content', 'createdUser'],
22
36
  handler: async ({ projectId, name, content, mailNotify }) => backlog.postWiki({
23
37
  projectId,
@@ -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 { IssueCountSchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const countIssuesSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
8
8
  issueTypeId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
@@ -44,5 +44,5 @@ declare const countIssuesSchema: (t: DescriptionHelper["t"]) => {
44
44
  value: z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>;
45
45
  }, z.core.$strip>], "type">>>;
46
46
  };
47
- export declare const countIssuesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof countIssuesSchema>, (typeof IssueCountSchema)["shape"]>;
47
+ export declare const countIssuesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof countIssuesSchema>, Entity.Issue.IssueCount>;
48
48
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { IssueCountSchema } 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 countIssuesSchema = buildToolSchema((t) => ({
@@ -94,7 +94,8 @@ export const countIssuesTool = (backlog, { t }) => {
94
94
  name: 'count_issues',
95
95
  description: t('TOOL_COUNT_ISSUES_DESCRIPTION', 'Returns count of issues'),
96
96
  schema: z.object(countIssuesSchema(t)),
97
- outputSchema: IssueCountSchema,
97
+ returnsList: false,
98
+ outputFields: outputFields()(['count']),
98
99
  handler: async ({ customFields, ...rest }) => {
99
100
  return backlog.getIssuesCount({
100
101
  ...rest,
@@ -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 { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const deleteIssueSchema: (t: DescriptionHelper["t"]) => {
7
7
  issueId: z.ZodOptional<z.ZodNumber>;
8
8
  issueKey: z.ZodOptional<z.ZodString>;
9
9
  };
10
- export declare const deleteIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteIssueSchema>, (typeof IssueSchema)["shape"]>;
10
+ export declare const deleteIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteIssueSchema>, Entity.Issue.Issue>;
11
11
  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
  const deleteIssueSchema = buildToolSchema((t) => ({
6
6
  issueId: z
@@ -17,7 +17,37 @@ export const deleteIssueTool = (backlog, { t }) => {
17
17
  name: 'delete_issue',
18
18
  description: t('TOOL_DELETE_ISSUE_DESCRIPTION', 'Deletes an issue'),
19
19
  schema: z.object(deleteIssueSchema(t)),
20
- outputSchema: IssueSchema,
20
+ returnsList: false,
21
+ outputFields: outputFields()([
22
+ 'id',
23
+ 'projectId',
24
+ 'issueKey',
25
+ 'keyId',
26
+ 'issueType',
27
+ 'summary',
28
+ 'description',
29
+ 'resolution',
30
+ 'priority',
31
+ 'status',
32
+ 'assignee',
33
+ 'category',
34
+ 'versions',
35
+ 'milestone',
36
+ 'startDate',
37
+ 'dueDate',
38
+ 'estimatedHours',
39
+ 'actualHours',
40
+ 'parentIssueId',
41
+ 'createdUser',
42
+ 'created',
43
+ 'updatedUser',
44
+ 'updated',
45
+ 'customFields',
46
+ 'attachments',
47
+ 'sharedFiles',
48
+ 'stars',
49
+ 'childIssueSummary',
50
+ ]),
21
51
  handler: async ({ issueId, issueKey }) => {
22
52
  const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
23
53
  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 deleteProjectSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  };
10
- export declare const deleteProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteProjectSchema>, (typeof ProjectSchema)["shape"]>;
10
+ export declare const deleteProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteProjectSchema>, 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 deleteProjectSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -17,7 +17,27 @@ export const deleteProjectTool = (backlog, { t }) => {
17
17
  name: 'delete_project',
18
18
  description: t('TOOL_DELETE_PROJECT_DESCRIPTION', 'Deletes a project'),
19
19
  schema: z.object(deleteProjectSchema(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,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 { VersionSchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const deleteVersionSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  id: z.ZodNumber;
10
10
  };
11
- export declare const deleteVersionTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteVersionSchema>, (typeof VersionSchema)["shape"]>;
11
+ export declare const deleteVersionTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteVersionSchema>, Entity.Project.Version>;
12
12
  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 deleteVersionSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -20,7 +20,17 @@ export const deleteVersionTool = (backlog, { t }) => {
20
20
  name: 'delete_version',
21
21
  description: t('TOOL_DELETE_VERSION_DESCRIPTION', 'Deletes a version from a project'),
22
22
  schema: z.object(deleteVersionSchema(t)),
23
- outputSchema: VersionSchema,
23
+ returnsList: false,
24
+ outputFields: outputFields()([
25
+ 'id',
26
+ 'projectId',
27
+ 'name',
28
+ 'description',
29
+ 'startDate',
30
+ 'releaseDueDate',
31
+ 'archived',
32
+ 'displayOrder',
33
+ ]),
24
34
  handler: async ({ projectId, projectKey, id }) => {
25
35
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
26
36
  if (!result.ok) {
@@ -1,10 +1,10 @@
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
6
  declare const deleteWatchingSchema: (t: DescriptionHelper["t"]) => {
7
7
  watchId: z.ZodNumber;
8
8
  };
9
- export declare const deleteWatchingTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteWatchingSchema>, (typeof WatchingListItemSchema)["shape"]>;
9
+ export declare const deleteWatchingTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteWatchingSchema>, Entity.WatchingList.WatchingListItem>;
10
10
  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 deleteWatchingSchema = buildToolSchema((t) => ({
5
5
  watchId: z
6
6
  .number()
@@ -11,7 +11,17 @@ export const deleteWatchingTool = (backlog, { t }) => {
11
11
  name: 'delete_watching',
12
12
  description: t('TOOL_DELETE_WATCHING_DESCRIPTION', 'Deletes a watch from an issue'),
13
13
  schema: z.object(deleteWatchingSchema(t)),
14
- outputSchema: WatchingListItemSchema,
14
+ returnsList: false,
15
+ outputFields: outputFields()([
16
+ 'id',
17
+ 'resourceAlreadyRead',
18
+ 'note',
19
+ 'type',
20
+ 'issue',
21
+ 'lastContentUpdated',
22
+ 'created',
23
+ 'updated',
24
+ ]),
15
25
  handler: async ({ watchId }) => backlog.deletehWatchingListItem(watchId),
16
26
  };
17
27
  };
@@ -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 { CategorySchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const getCategoriesSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  };
10
- export declare const getCategoriesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getCategoriesSchema>, (typeof CategorySchema)["shape"]>;
10
+ export declare const getCategoriesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getCategoriesSchema>, Entity.Project.Category>;
11
11
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { CategorySchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  const getCategoriesSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -18,7 +18,13 @@ export const getCategoriesTool = (backlog, { t }) => {
18
18
  description: t('TOOL_GET_CATEGORIES_DESCRIPTION', 'Returns list of categories for a project'),
19
19
  schema: z.object(getCategoriesSchema(t)),
20
20
  importantFields: ['id', 'projectId', 'name'],
21
- outputSchema: CategorySchema,
21
+ returnsList: true,
22
+ outputFields: outputFields()([
23
+ 'id',
24
+ 'projectId',
25
+ 'name',
26
+ 'displayOrder',
27
+ ]),
22
28
  handler: async ({ projectId, projectKey }) => {
23
29
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
24
30
  if (!result.ok) {
@@ -1,12 +1,12 @@
1
+ import type { Entity } from 'backlog-js';
1
2
  import { Backlog } from 'backlog-js';
2
3
  import { z } from 'zod';
3
4
  import { ToolDefinition } from '../types/tool.js';
4
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- import { CustomFieldSchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const getCustomFieldsInputSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  };
10
10
  export declare const getCustomFieldsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getCustomFieldsInputSchema>, // Shape for input schema
11
- (typeof CustomFieldSchema)["shape"]>;
11
+ Entity.Project.CustomField>;
12
12
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { CustomFieldSchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  const getCustomFieldsInputSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -18,7 +18,27 @@ export const getCustomFieldsTool = (backlog, { t }) => {
18
18
  name: 'get_custom_fields',
19
19
  description: t('TOOL_GET_CUSTOM_FIELDS_DESCRIPTION', 'Returns list of custom fields for a project'),
20
20
  schema: inputSchemaObject,
21
- outputSchema: CustomFieldSchema,
21
+ returnsList: true,
22
+ outputFields: outputFields()([
23
+ 'id',
24
+ 'projectId',
25
+ 'typeId',
26
+ 'name',
27
+ 'description',
28
+ 'required',
29
+ 'useIssueType',
30
+ 'applicableIssueTypes',
31
+ 'displayOrder',
32
+ 'version',
33
+ 'min',
34
+ 'max',
35
+ 'initialValue',
36
+ 'unit',
37
+ 'initialDate',
38
+ 'items',
39
+ 'allowAddItem',
40
+ 'allowInput',
41
+ ]),
22
42
  importantFields: [
23
43
  'id',
24
44
  'name',
@@ -1,10 +1,10 @@
1
+ import type { Entity } from 'backlog-js';
1
2
  import { Backlog } from 'backlog-js';
2
3
  import { z } from 'zod';
3
4
  import { DescriptionHelper } from '../createDescriptionHelper.js';
4
- import { DocumentItemSchema } from '../types/zod/backlogOutputDefinition.js';
5
5
  import { ToolDefinition } from '../types/tool.js';
6
6
  declare const getDocumentSchema: (t: DescriptionHelper["t"]) => {
7
7
  documentId: z.ZodString;
8
8
  };
9
- export declare const getDocumentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentSchema>, (typeof DocumentItemSchema)["shape"]>;
9
+ export declare const getDocumentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentSchema>, Entity.Document.Document>;
10
10
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { DocumentItemSchema } from '../types/zod/backlogOutputDefinition.js';
3
2
  import { buildToolSchema } from '../types/tool.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  const getDocumentSchema = buildToolSchema((t) => ({
5
5
  documentId: z
6
6
  .string()
@@ -11,7 +11,22 @@ export const getDocumentTool = (backlog, { t }) => {
11
11
  name: 'get_document',
12
12
  description: t('TOOL_GET_DOCUMENT_DESCRIPTION', 'Gets information about a document.'),
13
13
  schema: z.object(getDocumentSchema(t)),
14
- outputSchema: DocumentItemSchema,
14
+ returnsList: false,
15
+ outputFields: outputFields()([
16
+ 'id',
17
+ 'projectId',
18
+ 'title',
19
+ 'plain',
20
+ 'json',
21
+ 'statusId',
22
+ 'emoji',
23
+ 'attachments',
24
+ 'tags',
25
+ 'createdUser',
26
+ 'created',
27
+ 'updatedUser',
28
+ 'updated',
29
+ ]),
15
30
  importantFields: ['id', 'title', 'createdUser'],
16
31
  handler: async ({ documentId }) => {
17
32
  return backlog.getDocument(documentId);
@@ -1,10 +1,10 @@
1
+ import type { Entity } from 'backlog-js';
1
2
  import { Backlog } from 'backlog-js';
2
3
  import { z } from 'zod';
3
4
  import { DescriptionHelper } from '../createDescriptionHelper.js';
4
- import { DocumentTreeFullSchema } from '../types/zod/backlogOutputDefinition.js';
5
5
  import { ToolDefinition } from '../types/tool.js';
6
6
  declare const getDocumentTreeSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectIdOrKey: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
8
8
  };
9
- export declare const getDocumentTreeTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentTreeSchema>, typeof DocumentTreeFullSchema>;
9
+ export declare const getDocumentTreeTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentTreeSchema>, Entity.Document.DocumentTree>;
10
10
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { DocumentTreeFullSchemaZ, } from '../types/zod/backlogOutputDefinition.js';
3
2
  import { buildToolSchema } from '../types/tool.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  const getDocumentTreeSchema = buildToolSchema((t) => ({
5
5
  projectIdOrKey: z
6
6
  .union([z.string(), z.number()])
@@ -11,7 +11,12 @@ export const getDocumentTreeTool = (backlog, { t }) => {
11
11
  name: 'get_document_tree',
12
12
  description: t('TOOL_GET_DOCUMENT_TREE_DESCRIPTION', 'Gets the document tree of a project.'),
13
13
  schema: z.object(getDocumentTreeSchema(t)),
14
- outputSchema: DocumentTreeFullSchemaZ,
14
+ returnsList: false,
15
+ outputFields: outputFields()([
16
+ 'projectId',
17
+ 'activeTree',
18
+ 'trashTree',
19
+ ]),
15
20
  importantFields: ['projectId', 'activeTree', 'trashTree'],
16
21
  handler: async ({ projectIdOrKey }) => {
17
22
  return backlog.getDocumentTree(projectIdOrKey);
@@ -1,11 +1,11 @@
1
+ import type { Entity } from 'backlog-js';
1
2
  import { Backlog } from 'backlog-js';
2
3
  import { z } from 'zod';
3
4
  import { DescriptionHelper } from '../createDescriptionHelper.js';
4
- import { DocumentItemSchema } from '../types/zod/backlogOutputDefinition.js';
5
5
  import { ToolDefinition } from '../types/tool.js';
6
6
  declare const getDocumentsSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectIds: z.ZodArray<z.ZodNumber>;
8
8
  offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
9
9
  };
10
- export declare const getDocumentsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentsSchema>, (typeof DocumentItemSchema)["shape"]>;
10
+ export declare const getDocumentsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentsSchema>, Entity.Document.Document>;
11
11
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { DocumentItemSchema } from '../types/zod/backlogOutputDefinition.js';
3
2
  import { buildToolSchema } from '../types/tool.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  const getDocumentsSchema = buildToolSchema((t) => ({
5
5
  projectIds: z
6
6
  .array(z.number())
@@ -16,7 +16,22 @@ export const getDocumentsTool = (backlog, { t }) => {
16
16
  name: 'get_documents',
17
17
  description: t('TOOL_GET_DOCUMENTS_DESCRIPTION', 'Gets a list of documents in a project.'),
18
18
  schema: z.object(getDocumentsSchema(t)),
19
- outputSchema: DocumentItemSchema,
19
+ returnsList: true,
20
+ outputFields: outputFields()([
21
+ 'id',
22
+ 'projectId',
23
+ 'title',
24
+ 'plain',
25
+ 'json',
26
+ 'statusId',
27
+ 'emoji',
28
+ 'attachments',
29
+ 'tags',
30
+ 'createdUser',
31
+ 'created',
32
+ 'updatedUser',
33
+ 'updated',
34
+ ]),
20
35
  importantFields: ['id', 'projectId', 'title', 'plain'],
21
36
  handler: async ({ projectIds, offset }) => {
22
37
  return backlog.getDocuments({ projectId: projectIds, offset });
@@ -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 { GitRepositorySchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const getGitRepositoriesSchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  };
10
- export declare const getGitRepositoriesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getGitRepositoriesSchema>, (typeof GitRepositorySchema)["shape"]>;
10
+ export declare const getGitRepositoriesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getGitRepositoriesSchema>, Entity.Git.GitRepository>;
11
11
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { GitRepositorySchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
5
5
  const getGitRepositoriesSchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -17,7 +17,22 @@ export const getGitRepositoriesTool = (backlog, { t }) => {
17
17
  name: 'get_git_repositories',
18
18
  description: t('TOOL_GET_GIT_REPOSITORIES_DESCRIPTION', 'Returns list of Git repositories for a project'),
19
19
  schema: z.object(getGitRepositoriesSchema(t)),
20
- outputSchema: GitRepositorySchema,
20
+ returnsList: true,
21
+ outputFields: outputFields()([
22
+ 'id',
23
+ 'projectId',
24
+ 'name',
25
+ 'description',
26
+ 'hookUrl',
27
+ 'httpUrl',
28
+ 'sshUrl',
29
+ 'displayOrder',
30
+ 'pushedAt',
31
+ 'createdUser',
32
+ 'created',
33
+ 'updatedUser',
34
+ 'updated',
35
+ ]),
21
36
  handler: async ({ projectId, projectKey }) => {
22
37
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
23
38
  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 { GitRepositorySchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const getGitRepositorySchema: (t: DescriptionHelper["t"]) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  repoId: z.ZodOptional<z.ZodNumber>;
10
10
  repoName: z.ZodOptional<z.ZodString>;
11
11
  };
12
- export declare const getGitRepositoryTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getGitRepositorySchema>, (typeof GitRepositorySchema)["shape"]>;
12
+ export declare const getGitRepositoryTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getGitRepositorySchema>, Entity.Git.GitRepository>;
13
13
  export {};
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { buildToolSchema } from '../types/tool.js';
3
- import { GitRepositorySchema } from '../types/zod/backlogOutputDefinition.js';
3
+ import { outputFields } from '../types/outputFields.js';
4
4
  import { resolveIdOrKey, resolveIdOrName } from '../utils/resolveIdOrKey.js';
5
5
  const getGitRepositorySchema = buildToolSchema((t) => ({
6
6
  projectId: z
@@ -25,7 +25,22 @@ export const getGitRepositoryTool = (backlog, { t }) => {
25
25
  name: 'get_git_repository',
26
26
  description: t('TOOL_GET_GIT_REPOSITORY_DESCRIPTION', 'Returns information about a specific Git repository'),
27
27
  schema: z.object(getGitRepositorySchema(t)),
28
- outputSchema: GitRepositorySchema,
28
+ returnsList: false,
29
+ outputFields: outputFields()([
30
+ 'id',
31
+ 'projectId',
32
+ 'name',
33
+ 'description',
34
+ 'hookUrl',
35
+ 'httpUrl',
36
+ 'sshUrl',
37
+ 'displayOrder',
38
+ 'pushedAt',
39
+ 'createdUser',
40
+ 'created',
41
+ 'updatedUser',
42
+ 'updated',
43
+ ]),
29
44
  handler: async ({ projectId, projectKey, repoId, repoName }) => {
30
45
  const result = resolveIdOrKey('project', { id: projectId, key: projectKey }, t);
31
46
  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 { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
6
6
  declare const getIssueSchema: (t: DescriptionHelper["t"]) => {
7
7
  issueId: z.ZodOptional<z.ZodNumber>;
8
8
  issueKey: z.ZodOptional<z.ZodString>;
9
9
  };
10
- export declare const getIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssueSchema>, (typeof IssueSchema)["shape"]>;
10
+ export declare const getIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getIssueSchema>, Entity.Issue.Issue>;
11
11
  export {};