backlog-mcp-server 0.15.0 → 0.16.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 (118) hide show
  1. package/README.ja.md +20 -10
  2. package/README.md +20 -10
  3. package/build/auth/backlogAuthContext.d.ts +2 -0
  4. package/build/auth/backlogOAuthClient.d.ts +10 -0
  5. package/build/auth/backlogOAuthConfig.d.ts +9 -0
  6. package/build/auth/bearerAuthMiddleware.d.ts +4 -0
  7. package/build/auth/oauthRoutes.d.ts +4 -0
  8. package/build/auth/tokenStore.d.ts +62 -0
  9. package/build/backlog/backlogErrorHandler.d.ts +2 -0
  10. package/build/backlog/customFields.d.ts +29 -0
  11. package/build/backlog/parseBacklogAPIError.d.ts +8 -0
  12. package/build/createBacklogMcpServer.d.ts +29 -0
  13. package/build/createBacklogMcpServer.js +9 -4
  14. package/build/createDescriptionHelper.d.ts +18 -0
  15. package/build/createDescriptionHelper.js +24 -0
  16. package/build/handlers/builders/composeToolHandler.d.ts +31 -0
  17. package/build/handlers/builders/composeToolHandler.js +21 -9
  18. package/build/handlers/transformers/wrapWithErrorHandling.d.ts +2 -0
  19. package/build/handlers/transformers/wrapWithFieldPicking.d.ts +4 -0
  20. package/build/handlers/transformers/wrapWithOrganizationContext.d.ts +3 -0
  21. package/build/handlers/transformers/wrapWithTokenLimit.d.ts +2 -0
  22. package/build/handlers/transformers/wrapWithToolResult.d.ts +6 -0
  23. package/build/httpMcpServer.d.ts +22 -0
  24. package/build/index.d.ts +2 -0
  25. package/build/index.js +29 -11
  26. package/build/lib.d.ts +25 -0
  27. package/build/lib.js +20 -0
  28. package/build/loadDescriptionOverrides.d.ts +17 -0
  29. package/build/loadDescriptionOverrides.js +24 -0
  30. package/build/registerTools.d.ts +5 -0
  31. package/build/registerTools.js +7 -6
  32. package/build/tools/addDocument.d.ts +15 -0
  33. package/build/tools/addIssue.d.ts +30 -0
  34. package/build/tools/addIssueComment.d.ts +14 -0
  35. package/build/tools/addProject.d.ts +18 -0
  36. package/build/tools/addPullRequest.d.ts +20 -0
  37. package/build/tools/addPullRequestComment.d.ts +16 -0
  38. package/build/tools/addRelatedIssue.d.ts +12 -0
  39. package/build/tools/addVersionMilestone.d.ts +15 -0
  40. package/build/tools/addWatching.d.ts +11 -0
  41. package/build/tools/addWiki.d.ts +13 -0
  42. package/build/tools/countIssues.d.ts +48 -0
  43. package/build/tools/deleteIssue.d.ts +11 -0
  44. package/build/tools/deleteProject.d.ts +11 -0
  45. package/build/tools/deleteVersion.d.ts +12 -0
  46. package/build/tools/deleteWatching.d.ts +10 -0
  47. package/build/tools/dynamicTools/organizations.d.ts +6 -0
  48. package/build/tools/dynamicTools/toolsets.d.ts +15 -0
  49. package/build/tools/getCategories.d.ts +11 -0
  50. package/build/tools/getCustomFields.d.ts +12 -0
  51. package/build/tools/getDocument.d.ts +10 -0
  52. package/build/tools/getDocumentTree.d.ts +10 -0
  53. package/build/tools/getDocuments.d.ts +11 -0
  54. package/build/tools/getGitRepositories.d.ts +11 -0
  55. package/build/tools/getGitRepository.d.ts +13 -0
  56. package/build/tools/getIssue.d.ts +11 -0
  57. package/build/tools/getIssueComments.d.ts +18 -0
  58. package/build/tools/getIssueTypes.d.ts +11 -0
  59. package/build/tools/getIssues.d.ts +75 -0
  60. package/build/tools/getMyself.d.ts +7 -0
  61. package/build/tools/getNotifications.d.ts +16 -0
  62. package/build/tools/getNotificationsCount.d.ts +11 -0
  63. package/build/tools/getPriorities.d.ts +7 -0
  64. package/build/tools/getProject.d.ts +11 -0
  65. package/build/tools/getProjectList.d.ts +11 -0
  66. package/build/tools/getProjectUsers.d.ts +11 -0
  67. package/build/tools/getPullRequest.d.ts +14 -0
  68. package/build/tools/getPullRequestComments.d.ts +21 -0
  69. package/build/tools/getPullRequests.d.ts +19 -0
  70. package/build/tools/getPullRequestsCount.d.ts +17 -0
  71. package/build/tools/getRelatedIssues.d.ts +11 -0
  72. package/build/tools/getResolutions.d.ts +7 -0
  73. package/build/tools/getSpace.d.ts +7 -0
  74. package/build/tools/getSpaceActivities.d.ts +45 -0
  75. package/build/tools/getUserRecentUpdates.d.ts +46 -0
  76. package/build/tools/getUserStarsCount.d.ts +12 -0
  77. package/build/tools/getUsers.d.ts +7 -0
  78. package/build/tools/getVersionMilestoneList.d.ts +11 -0
  79. package/build/tools/getWatchingListCount.d.ts +10 -0
  80. package/build/tools/getWatchingListItems.d.ts +10 -0
  81. package/build/tools/getWiki.d.ts +10 -0
  82. package/build/tools/getWikiPages.d.ts +12 -0
  83. package/build/tools/getWikisCount.d.ts +11 -0
  84. package/build/tools/markNotificationAsRead.d.ts +13 -0
  85. package/build/tools/markWatchingAsRead.d.ts +13 -0
  86. package/build/tools/removeRelatedIssue.d.ts +12 -0
  87. package/build/tools/resetUnreadNotificationCount.d.ts +7 -0
  88. package/build/tools/shared/customFieldFiltersSchema.d.ts +21 -0
  89. package/build/tools/tools.d.ts +4 -0
  90. package/build/tools/updateIssue.d.ts +34 -0
  91. package/build/tools/updateIssueComment.d.ts +13 -0
  92. package/build/tools/updateProject.d.ts +21 -0
  93. package/build/tools/updatePullRequest.d.ts +20 -0
  94. package/build/tools/updatePullRequestComment.d.ts +16 -0
  95. package/build/tools/updateVersionMilestone.d.ts +17 -0
  96. package/build/tools/updateWatching.d.ts +11 -0
  97. package/build/tools/updateWiki.d.ts +13 -0
  98. package/build/types/mcp.d.ts +10 -0
  99. package/build/types/result.d.ts +10 -0
  100. package/build/types/tool.d.ts +24 -0
  101. package/build/types/toolsets.d.ts +16 -0
  102. package/build/types/zod/backlogOutputDefinition.d.ts +3334 -0
  103. package/build/types/zod/backlogOutputDefinition.js +0 -16
  104. package/build/utils/backlogClientRegistry.d.ts +28 -0
  105. package/build/utils/backlogClientRegistry.js +4 -0
  106. package/build/utils/backlogOrganizationContext.d.ts +2 -0
  107. package/build/utils/generateFieldsDescription.d.ts +5 -0
  108. package/build/utils/logger.d.ts +2 -0
  109. package/build/utils/logger.js +27 -14
  110. package/build/utils/resolveIdOrKey.d.ts +18 -0
  111. package/build/utils/runToolSafely.d.ts +6 -0
  112. package/build/utils/tokenCounter.d.ts +1 -0
  113. package/build/utils/toolRegistrar.d.ts +5 -0
  114. package/build/utils/toolsetUtils.d.ts +6 -0
  115. package/build/utils/toolsetUtils.js +0 -20
  116. package/build/utils/wrapServerWithToolRegistry.d.ts +6 -0
  117. package/package.json +12 -3
  118. package/build/createTranslationHelper.js +0 -28
package/build/index.js CHANGED
@@ -7,7 +7,8 @@ import yargs from 'yargs';
7
7
  import { hideBin } from 'yargs/helpers';
8
8
  import { getBacklogOAuthConfig } from './auth/backlogOAuthConfig.js';
9
9
  import { createTokenStore } from './auth/tokenStore.js';
10
- import { createTranslationHelper } from './createTranslationHelper.js';
10
+ import { createDescriptionHelper } from './createDescriptionHelper.js';
11
+ import { loadDescriptionOverrides } from './loadDescriptionOverrides.js';
11
12
  import { createBacklogMcpServer } from './createBacklogMcpServer.js';
12
13
  import { runHttpMcpServer } from './httpMcpServer.js';
13
14
  import { createBacklogClientRegistry, createOAuthBacklogClientRegistry, } from './utils/backlogClientRegistry.js';
@@ -97,9 +98,14 @@ const argv = yargs(hideBin(process.argv))
97
98
  describe: 'Optional string prefix to prepend to all generated outputs',
98
99
  default: env.get('PREFIX').default('').asString(),
99
100
  })
100
- .option('export-translations', {
101
+ .option('export-descriptions', {
101
102
  type: 'boolean',
102
- describe: 'Export translations and exit',
103
+ // Deprecated alias, to be removed in a future release. Kept because the old name is
104
+ // documented with docker and npx examples, and dropping it outright would
105
+ // not fail loudly: yargs ignores unknown flags, so the process would fall
106
+ // through to starting a server and the caller would see a hang.
107
+ alias: 'export-translations',
108
+ describe: 'Export tool and parameter descriptions and exit',
103
109
  default: false,
104
110
  })
105
111
  .option('enable-toolsets', {
@@ -120,6 +126,13 @@ Available toolsets:
120
126
  default: env.get('ENABLE_DYNAMIC_TOOLSETS').default('false').asBool(),
121
127
  })
122
128
  .parseSync();
129
+ // The alias resolves both spellings to the same argv key, so which one was typed
130
+ // is only visible in the raw arguments. Written straight to stderr rather than
131
+ // through `logger`, which drops anything below `error` in production — and stdout
132
+ // carries the JSON-RPC stream, so a notice there would corrupt the protocol.
133
+ if (hideBin(process.argv).some((arg) => arg.split('=')[0] === '--export-translations')) {
134
+ process.stderr.write('--export-translations is deprecated and will be removed in a future release. Use --export-descriptions.\n');
135
+ }
123
136
  const clientRegistry = oauthConfig
124
137
  ? createOAuthBacklogClientRegistry(oauthConfig.backlogDomain)
125
138
  : createBacklogClientRegistry();
@@ -131,19 +144,24 @@ if (tokenStore) {
131
144
  cleanupTimer.unref();
132
145
  }
133
146
  const useFields = argv.optimizeResponse;
134
- const transHelper = createTranslationHelper();
147
+ const descriptionHelper = createDescriptionHelper(loadDescriptionOverrides());
135
148
  const maxTokens = argv.maxTokens;
136
149
  const prefix = argv.prefix;
137
150
  const enabledToolsets = argv.dynamicToolsets
138
151
  ? argv.enableToolsets.filter((a) => a !== 'all')
139
152
  : argv.enableToolsets;
140
- const mcpOption = { useFields: useFields, maxTokens, prefix };
153
+ const mcpOption = {
154
+ useFields: useFields,
155
+ maxTokens,
156
+ prefix,
157
+ useOrganization: clientRegistry.isMultiOrganization,
158
+ };
141
159
  // Built once and shared by every server the factory produces. `enable_toolset`
142
160
  // mutates this group, and the stateless HTTP model discards its server after
143
161
  // each request — so a per-server group would lose the enablement immediately.
144
162
  // Sharing it makes toolset state process-wide, which is the only scope left now
145
163
  // that the protocol has no sessions.
146
- const sharedToolsetGroup = buildToolsetGroup(backlog, transHelper, enabledToolsets);
164
+ const sharedToolsetGroup = buildToolsetGroup(backlog, descriptionHelper, enabledToolsets);
147
165
  // Factory: creates a fresh MCP server with all tools registered.
148
166
  // Used once per stdio connection; one fresh instance per HTTP request.
149
167
  const createServer = () => createBacklogMcpServer({
@@ -151,14 +169,14 @@ const createServer = () => createBacklogMcpServer({
151
169
  useFields,
152
170
  backlog,
153
171
  clientRegistry,
154
- transHelper,
172
+ descriptionHelper,
155
173
  enabledToolsets,
156
174
  mcpOption,
157
175
  dynamicToolsets: argv.dynamicToolsets,
158
176
  toolsetGroup: sharedToolsetGroup,
159
177
  });
160
- if (argv.exportTranslations) {
161
- // Translation keys are only recorded once a tool asks for them, so build a
178
+ if (argv.exportDescriptions) {
179
+ // Description keys are only recorded once a tool asks for them, so build a
162
180
  // server with every toolset enabled before dumping. Without this the dump is
163
181
  // empty, because no tool has been created yet at this point.
164
182
  createBacklogMcpServer({
@@ -166,12 +184,12 @@ if (argv.exportTranslations) {
166
184
  useFields,
167
185
  backlog,
168
186
  clientRegistry,
169
- transHelper,
187
+ descriptionHelper,
170
188
  enabledToolsets: ['all'],
171
189
  mcpOption,
172
190
  dynamicToolsets: true,
173
191
  });
174
- const data = transHelper.dump();
192
+ const data = descriptionHelper.dump();
175
193
  // eslint-disable-next-line no-console
176
194
  console.log(JSON.stringify(data, null, 2));
177
195
  process.exit(0);
package/build/lib.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Library entry point.
3
+ *
4
+ * `src/index.ts` is the CLI: it parses argv, reads config files and starts a
5
+ * transport. Consumers that only want the tool layer — to host the same tools on
6
+ * a different runtime, for example — cannot import it without running all of that.
7
+ * This module exposes the pieces needed to build a server, and nothing that runs
8
+ * on import.
9
+ *
10
+ * Nothing reachable from here may touch a Node built-in. `loadDescriptionOverrides`
11
+ * is the counter-example worth remembering: it reads the override file from disk,
12
+ * so it belongs to the CLI and is deliberately absent below. Consumers on other
13
+ * runtimes pass their own overrides to `createDescriptionHelper`.
14
+ */
15
+ export { allTools } from './tools/tools.js';
16
+ export { composeToolHandler } from './handlers/builders/composeToolHandler.js';
17
+ export { createDescriptionHelper } from './createDescriptionHelper.js';
18
+ export { backlogErrorHandler } from './backlog/backlogErrorHandler.js';
19
+ export { buildToolSchema } from './types/tool.js';
20
+ export { isErrorLike } from './types/result.js';
21
+ export type { ComposeOptions } from './handlers/builders/composeToolHandler.js';
22
+ export type { DescriptionHelper } from './createDescriptionHelper.js';
23
+ export type { ToolDefinition, DynamicToolDefinition, ToolRegistrar, } from './types/tool.js';
24
+ export type { Toolset, ToolsetGroup, DynamicToolset, DynamicToolsetGroup, } from './types/toolsets.js';
25
+ export type { ErrorLike, SafeResult } from './types/result.js';
package/build/lib.js ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Library entry point.
3
+ *
4
+ * `src/index.ts` is the CLI: it parses argv, reads config files and starts a
5
+ * transport. Consumers that only want the tool layer — to host the same tools on
6
+ * a different runtime, for example — cannot import it without running all of that.
7
+ * This module exposes the pieces needed to build a server, and nothing that runs
8
+ * on import.
9
+ *
10
+ * Nothing reachable from here may touch a Node built-in. `loadDescriptionOverrides`
11
+ * is the counter-example worth remembering: it reads the override file from disk,
12
+ * so it belongs to the CLI and is deliberately absent below. Consumers on other
13
+ * runtimes pass their own overrides to `createDescriptionHelper`.
14
+ */
15
+ export { allTools } from './tools/tools.js';
16
+ export { composeToolHandler } from './handlers/builders/composeToolHandler.js';
17
+ export { createDescriptionHelper } from './createDescriptionHelper.js';
18
+ export { backlogErrorHandler } from './backlog/backlogErrorHandler.js';
19
+ export { buildToolSchema } from './types/tool.js';
20
+ export { isErrorLike } from './types/result.js';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Reads description overrides from a `.backlog-mcp-serverrc` file (`.json`,
3
+ * `.yaml` or `.yml`) in the user's home directory.
4
+ *
5
+ * Node-only, and kept separate from `createDescriptionHelper` for that reason:
6
+ * cosmiconfig walks the filesystem and the default search path is the home
7
+ * directory. The CLI calls this and hands the result to the helper.
8
+ *
9
+ * The file is user-authored, so its contents are unknown: anything that is not a
10
+ * string is dropped here rather than passed on. Most overrides end up in a tool
11
+ * description, and a number or an array there would produce an invalid
12
+ * `tools/list` payload.
13
+ */
14
+ export declare function loadDescriptionOverrides(options?: {
15
+ configName?: string;
16
+ searchDir?: string;
17
+ }): Record<string, string>;
@@ -0,0 +1,24 @@
1
+ import { cosmiconfigSync } from 'cosmiconfig';
2
+ import os from 'os';
3
+ /**
4
+ * Reads description overrides from a `.backlog-mcp-serverrc` file (`.json`,
5
+ * `.yaml` or `.yml`) in the user's home directory.
6
+ *
7
+ * Node-only, and kept separate from `createDescriptionHelper` for that reason:
8
+ * cosmiconfig walks the filesystem and the default search path is the home
9
+ * directory. The CLI calls this and hands the result to the helper.
10
+ *
11
+ * The file is user-authored, so its contents are unknown: anything that is not a
12
+ * string is dropped here rather than passed on. Most overrides end up in a tool
13
+ * description, and a number or an array there would produce an invalid
14
+ * `tools/list` payload.
15
+ */
16
+ export function loadDescriptionOverrides(options) {
17
+ const explorer = cosmiconfigSync(options?.configName ?? 'backlog-mcp-server');
18
+ const searchPath = options?.searchDir ?? os.homedir();
19
+ const config = explorer.search(searchPath)?.config;
20
+ if (typeof config !== 'object' || config === null || Array.isArray(config)) {
21
+ return {};
22
+ }
23
+ return Object.fromEntries(Object.entries(config).filter(([, value]) => typeof value === 'string'));
24
+ }
@@ -0,0 +1,5 @@
1
+ import { MCPOptions } from './types/mcp.js';
2
+ import { DynamicToolsetGroup, ToolsetGroup } from './types/toolsets.js';
3
+ import { BacklogMCPServer } from './utils/wrapServerWithToolRegistry.js';
4
+ export declare function registerTools(server: BacklogMCPServer, toolsetGroup: ToolsetGroup, options: MCPOptions): void;
5
+ export declare function registerDynamicTools(server: BacklogMCPServer, dynamicToolsetGroup: DynamicToolsetGroup, prefix: string): void;
@@ -1,17 +1,18 @@
1
1
  import { backlogErrorHandler } from './backlog/backlogErrorHandler.js';
2
2
  import { composeToolHandler } from './handlers/builders/composeToolHandler.js';
3
3
  export function registerTools(server, toolsetGroup, options) {
4
- const { useFields, maxTokens, prefix } = options;
4
+ const { useFields, maxTokens, prefix, useOrganization } = options;
5
5
  registerToolsets({
6
6
  server,
7
7
  toolsetGroup,
8
8
  prefix,
9
- handlerStrategy: (tool) =>
9
+ prepareTool: (tool) =>
10
10
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
11
  composeToolHandler(tool, {
12
12
  useFields,
13
13
  errorHandler: backlogErrorHandler,
14
14
  maxTokens,
15
+ useOrganization,
15
16
  }),
16
17
  });
17
18
  }
@@ -20,18 +21,18 @@ export function registerDynamicTools(server, dynamicToolsetGroup, prefix) {
20
21
  server,
21
22
  toolsetGroup: dynamicToolsetGroup,
22
23
  prefix,
23
- handlerStrategy: (tool) => tool.handler,
24
+ prepareTool: (tool) => ({ schema: tool.schema, handler: tool.handler }),
24
25
  });
25
26
  }
26
- function registerToolsets({ server, toolsetGroup, prefix, handlerStrategy, }) {
27
+ function registerToolsets({ server, toolsetGroup, prefix, prepareTool, }) {
27
28
  for (const toolset of toolsetGroup.toolsets) {
28
29
  if (!toolset.enabled) {
29
30
  continue;
30
31
  }
31
32
  for (const tool of toolset.tools) {
32
33
  const toolNameWithPrefix = `${prefix}${tool.name}`;
33
- const handler = handlerStrategy(tool);
34
- server.registerOnce(toolNameWithPrefix, tool.description, tool.schema, handler);
34
+ const { schema, handler } = prepareTool(tool);
35
+ server.registerOnce(toolNameWithPrefix, tool.description, schema, handler);
35
36
  }
36
37
  }
37
38
  }
@@ -0,0 +1,15 @@
1
+ import { Backlog } from 'backlog-js';
2
+ import { z } from 'zod';
3
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
4
+ import { DocumentItemSchema } from '../types/zod/backlogOutputDefinition.js';
5
+ import { ToolDefinition } from '../types/tool.js';
6
+ declare const addDocumentSchema: (t: DescriptionHelper["t"]) => {
7
+ projectId: z.ZodNumber;
8
+ title: z.ZodOptional<z.ZodString>;
9
+ content: z.ZodOptional<z.ZodString>;
10
+ emoji: z.ZodOptional<z.ZodString>;
11
+ parentId: z.ZodOptional<z.ZodString>;
12
+ addLast: z.ZodOptional<z.ZodBoolean>;
13
+ };
14
+ export declare const addDocumentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addDocumentSchema>, (typeof DocumentItemSchema)["shape"]>;
15
+ export {};
@@ -0,0 +1,30 @@
1
+ import { Backlog } from 'backlog-js';
2
+ import { z } from 'zod';
3
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
4
+ import { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
5
+ import { ToolDefinition } from '../types/tool.js';
6
+ declare const addIssueSchema: (t: DescriptionHelper["t"]) => {
7
+ projectId: z.ZodNumber;
8
+ summary: z.ZodString;
9
+ issueTypeId: z.ZodNumber;
10
+ priorityId: z.ZodNumber;
11
+ description: z.ZodOptional<z.ZodString>;
12
+ startDate: z.ZodOptional<z.ZodString>;
13
+ dueDate: z.ZodOptional<z.ZodString>;
14
+ estimatedHours: z.ZodOptional<z.ZodNumber>;
15
+ actualHours: z.ZodOptional<z.ZodNumber>;
16
+ categoryId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
17
+ versionId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
18
+ milestoneId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
19
+ assigneeId: z.ZodOptional<z.ZodNumber>;
20
+ notifiedUserId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
21
+ attachmentId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
22
+ parentIssueId: z.ZodOptional<z.ZodNumber>;
23
+ customFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
24
+ id: z.ZodNumber;
25
+ value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>]>>;
26
+ otherValue: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strip>>>;
28
+ };
29
+ export declare const addIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addIssueSchema>, (typeof IssueSchema)["shape"]>;
30
+ export {};
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { IssueCommentSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const addIssueCommentSchema: (t: DescriptionHelper["t"]) => {
7
+ issueId: z.ZodOptional<z.ZodNumber>;
8
+ issueKey: z.ZodOptional<z.ZodString>;
9
+ content: z.ZodString;
10
+ notifiedUserId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
11
+ attachmentId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
12
+ };
13
+ export declare const addIssueCommentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addIssueCommentSchema>, (typeof IssueCommentSchema)["shape"]>;
14
+ export {};
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { ProjectSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const addProjectSchema: (t: DescriptionHelper["t"]) => {
7
+ name: z.ZodString;
8
+ key: z.ZodString;
9
+ chartEnabled: z.ZodOptional<z.ZodBoolean>;
10
+ subtaskingEnabled: z.ZodOptional<z.ZodBoolean>;
11
+ projectLeaderCanEditProjectLeader: z.ZodOptional<z.ZodBoolean>;
12
+ textFormattingRule: z.ZodOptional<z.ZodEnum<{
13
+ backlog: "backlog";
14
+ markdown: "markdown";
15
+ }>>;
16
+ };
17
+ export declare const addProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addProjectSchema>, (typeof ProjectSchema)["shape"]>;
18
+ export {};
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { PullRequestSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const addPullRequestSchema: (t: DescriptionHelper["t"]) => {
7
+ projectId: z.ZodOptional<z.ZodNumber>;
8
+ projectKey: z.ZodOptional<z.ZodString>;
9
+ repoId: z.ZodOptional<z.ZodNumber>;
10
+ repoName: z.ZodOptional<z.ZodString>;
11
+ summary: z.ZodString;
12
+ description: z.ZodString;
13
+ base: z.ZodString;
14
+ branch: z.ZodString;
15
+ issueId: z.ZodOptional<z.ZodNumber>;
16
+ assigneeId: z.ZodOptional<z.ZodNumber>;
17
+ notifiedUserId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
18
+ };
19
+ export declare const addPullRequestTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addPullRequestSchema>, (typeof PullRequestSchema)["shape"]>;
20
+ export {};
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { PullRequestCommentSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const addPullRequestCommentSchema: (t: DescriptionHelper["t"]) => {
7
+ projectId: z.ZodOptional<z.ZodNumber>;
8
+ projectKey: z.ZodOptional<z.ZodString>;
9
+ repoId: z.ZodOptional<z.ZodNumber>;
10
+ repoName: z.ZodOptional<z.ZodString>;
11
+ number: z.ZodNumber;
12
+ content: z.ZodString;
13
+ notifiedUserId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
14
+ };
15
+ export declare const addPullRequestCommentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addPullRequestCommentSchema>, (typeof PullRequestCommentSchema)["shape"]>;
16
+ export {};
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { RelatedIssueSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const addRelatedIssueSchema: (t: DescriptionHelper["t"]) => {
7
+ issueId: z.ZodOptional<z.ZodNumber>;
8
+ issueKey: z.ZodOptional<z.ZodString>;
9
+ targetIssueId: z.ZodNumber;
10
+ };
11
+ export declare const addRelatedIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addRelatedIssueSchema>, (typeof RelatedIssueSchema)["shape"]>;
12
+ export {};
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { VersionSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const addVersionMilestoneSchema: (t: DescriptionHelper["t"]) => {
7
+ projectId: z.ZodOptional<z.ZodNumber>;
8
+ projectKey: z.ZodOptional<z.ZodString>;
9
+ name: z.ZodString;
10
+ description: z.ZodOptional<z.ZodString>;
11
+ startDate: z.ZodOptional<z.ZodString>;
12
+ releaseDueDate: z.ZodOptional<z.ZodString>;
13
+ };
14
+ export declare const addVersionMilestoneTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addVersionMilestoneSchema>, (typeof VersionSchema)["shape"]>;
15
+ export {};
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { WatchingListItemSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const addWatchingSchema: (t: DescriptionHelper["t"]) => {
7
+ issueIdOrKey: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
8
+ note: z.ZodDefault<z.ZodOptional<z.ZodString>>;
9
+ };
10
+ export declare const addWatchingTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addWatchingSchema>, (typeof WatchingListItemSchema)["shape"]>;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { WikiSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const addWikiSchema: (t: DescriptionHelper["t"]) => {
7
+ projectId: z.ZodNumber;
8
+ name: z.ZodString;
9
+ content: z.ZodString;
10
+ mailNotify: z.ZodOptional<z.ZodBoolean>;
11
+ };
12
+ export declare const addWikiTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof addWikiSchema>, (typeof WikiSchema)["shape"]>;
13
+ export {};
@@ -0,0 +1,48 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { IssueCountSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const countIssuesSchema: (t: DescriptionHelper["t"]) => {
7
+ projectId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
8
+ issueTypeId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
9
+ categoryId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
10
+ versionId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
11
+ milestoneId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
12
+ statusId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
13
+ priorityId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
14
+ assigneeId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
15
+ createdUserId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
16
+ resolutionId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
17
+ parentIssueId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
18
+ keyword: z.ZodOptional<z.ZodString>;
19
+ startDateSince: z.ZodOptional<z.ZodString>;
20
+ startDateUntil: z.ZodOptional<z.ZodString>;
21
+ dueDateSince: z.ZodOptional<z.ZodString>;
22
+ dueDateUntil: z.ZodOptional<z.ZodString>;
23
+ createdSince: z.ZodOptional<z.ZodString>;
24
+ createdUntil: z.ZodOptional<z.ZodString>;
25
+ updatedSince: z.ZodOptional<z.ZodString>;
26
+ updatedUntil: z.ZodOptional<z.ZodString>;
27
+ customFields: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
28
+ type: z.ZodLiteral<"text">;
29
+ id: z.ZodNumber;
30
+ value: z.ZodString;
31
+ }, z.core.$strip>, z.ZodObject<{
32
+ type: z.ZodLiteral<"numeric">;
33
+ id: z.ZodNumber;
34
+ min: z.ZodOptional<z.ZodNumber>;
35
+ max: z.ZodOptional<z.ZodNumber>;
36
+ }, z.core.$strip>, z.ZodObject<{
37
+ type: z.ZodLiteral<"date">;
38
+ id: z.ZodNumber;
39
+ min: z.ZodOptional<z.ZodString>;
40
+ max: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strip>, z.ZodObject<{
42
+ type: z.ZodLiteral<"list">;
43
+ id: z.ZodNumber;
44
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>;
45
+ }, z.core.$strip>], "type">>>;
46
+ };
47
+ export declare const countIssuesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof countIssuesSchema>, (typeof IssueCountSchema)["shape"]>;
48
+ export {};
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { IssueSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const deleteIssueSchema: (t: DescriptionHelper["t"]) => {
7
+ issueId: z.ZodOptional<z.ZodNumber>;
8
+ issueKey: z.ZodOptional<z.ZodString>;
9
+ };
10
+ export declare const deleteIssueTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteIssueSchema>, (typeof IssueSchema)["shape"]>;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { ProjectSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const deleteProjectSchema: (t: DescriptionHelper["t"]) => {
7
+ projectId: z.ZodOptional<z.ZodNumber>;
8
+ projectKey: z.ZodOptional<z.ZodString>;
9
+ };
10
+ export declare const deleteProjectTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteProjectSchema>, (typeof ProjectSchema)["shape"]>;
11
+ export {};
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { VersionSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const deleteVersionSchema: (t: DescriptionHelper["t"]) => {
7
+ projectId: z.ZodOptional<z.ZodNumber>;
8
+ projectKey: z.ZodOptional<z.ZodString>;
9
+ id: z.ZodNumber;
10
+ };
11
+ export declare const deleteVersionTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteVersionSchema>, (typeof VersionSchema)["shape"]>;
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { WatchingListItemSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const deleteWatchingSchema: (t: DescriptionHelper["t"]) => {
7
+ watchId: z.ZodNumber;
8
+ };
9
+ export declare const deleteWatchingTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof deleteWatchingSchema>, (typeof WatchingListItemSchema)["shape"]>;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ import { DescriptionHelper } from '../../createDescriptionHelper.js';
2
+ import { BacklogClientRegistry } from '../../utils/backlogClientRegistry.js';
3
+ import { DynamicToolDefinition } from '../../types/tool.js';
4
+ import { DynamicToolsetGroup } from '../../types/toolsets.js';
5
+ export declare function organizationTools(registry: BacklogClientRegistry, { t }: DescriptionHelper): DynamicToolsetGroup;
6
+ export declare function listOrganizationsTool(registry: BacklogClientRegistry, t: DescriptionHelper['t']): DynamicToolDefinition<Record<string, never>>;
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { DynamicToolDefinition, ToolRegistrar } from '../../types/tool.js';
3
+ import { DynamicToolsetGroup, ToolsetGroup } from '../../types/toolsets.js';
4
+ import { DescriptionHelper } from '../../createDescriptionHelper.js';
5
+ export declare const dynamicTools: (toolRegistrar: ToolRegistrar, helper: DescriptionHelper, toolsetGroup: ToolsetGroup) => DynamicToolsetGroup;
6
+ declare const enableToolsetSchema: (t: DescriptionHelper["t"]) => {
7
+ toolset: z.ZodString;
8
+ };
9
+ export declare const enableToolsetTool: (toolRegistrar: ToolRegistrar, { t }: DescriptionHelper) => DynamicToolDefinition<ReturnType<typeof enableToolsetSchema>>;
10
+ export declare const listAvailableToolsets: ({ t }: DescriptionHelper, toolsetGroup: ToolsetGroup) => DynamicToolDefinition<Record<string, never>>;
11
+ declare const getToolsetToolsSchema: (t: DescriptionHelper["t"]) => {
12
+ toolset: z.ZodString;
13
+ };
14
+ export declare const getToolsetTools: ({ t }: DescriptionHelper, toolsetGroup: ToolsetGroup) => DynamicToolDefinition<ReturnType<typeof getToolsetToolsSchema>>;
15
+ export {};
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { CategorySchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const getCategoriesSchema: (t: DescriptionHelper["t"]) => {
7
+ projectId: z.ZodOptional<z.ZodNumber>;
8
+ projectKey: z.ZodOptional<z.ZodString>;
9
+ };
10
+ export declare const getCategoriesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getCategoriesSchema>, (typeof CategorySchema)["shape"]>;
11
+ export {};
@@ -0,0 +1,12 @@
1
+ import { Backlog } from 'backlog-js';
2
+ import { z } from 'zod';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { CustomFieldSchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const getCustomFieldsInputSchema: (t: DescriptionHelper["t"]) => {
7
+ projectId: z.ZodOptional<z.ZodNumber>;
8
+ projectKey: z.ZodOptional<z.ZodString>;
9
+ };
10
+ export declare const getCustomFieldsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getCustomFieldsInputSchema>, // Shape for input schema
11
+ (typeof CustomFieldSchema)["shape"]>;
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Backlog } from 'backlog-js';
2
+ import { z } from 'zod';
3
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
4
+ import { DocumentItemSchema } from '../types/zod/backlogOutputDefinition.js';
5
+ import { ToolDefinition } from '../types/tool.js';
6
+ declare const getDocumentSchema: (t: DescriptionHelper["t"]) => {
7
+ documentId: z.ZodString;
8
+ };
9
+ export declare const getDocumentTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentSchema>, (typeof DocumentItemSchema)["shape"]>;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Backlog } from 'backlog-js';
2
+ import { z } from 'zod';
3
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
4
+ import { DocumentTreeFullSchema } from '../types/zod/backlogOutputDefinition.js';
5
+ import { ToolDefinition } from '../types/tool.js';
6
+ declare const getDocumentTreeSchema: (t: DescriptionHelper["t"]) => {
7
+ projectIdOrKey: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
8
+ };
9
+ export declare const getDocumentTreeTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentTreeSchema>, typeof DocumentTreeFullSchema>;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import { Backlog } from 'backlog-js';
2
+ import { z } from 'zod';
3
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
4
+ import { DocumentItemSchema } from '../types/zod/backlogOutputDefinition.js';
5
+ import { ToolDefinition } from '../types/tool.js';
6
+ declare const getDocumentsSchema: (t: DescriptionHelper["t"]) => {
7
+ projectIds: z.ZodArray<z.ZodNumber>;
8
+ offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
9
+ };
10
+ export declare const getDocumentsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getDocumentsSchema>, (typeof DocumentItemSchema)["shape"]>;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { Backlog } from 'backlog-js';
3
+ import { ToolDefinition } from '../types/tool.js';
4
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
5
+ import { GitRepositorySchema } from '../types/zod/backlogOutputDefinition.js';
6
+ declare const getGitRepositoriesSchema: (t: DescriptionHelper["t"]) => {
7
+ projectId: z.ZodOptional<z.ZodNumber>;
8
+ projectKey: z.ZodOptional<z.ZodString>;
9
+ };
10
+ export declare const getGitRepositoriesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getGitRepositoriesSchema>, (typeof GitRepositorySchema)["shape"]>;
11
+ export {};