add_watching
Monitor Backlog issues by adding watches to track updates and changes using issue IDs or keys.
Instructions
Adds a new watch to an issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueIdOrKey | Yes | Issue ID or issue key (e.g., 1234 or "PROJECT-123") | |
| note | No | Optional note for the watch |
Implementation Reference
- src/tools/addWatching.ts:38-42 (handler)The async handler function that executes the core logic of the 'add_watching' tool by calling the Backlog client's postWatchingListItem method.handler: async ({ issueIdOrKey, note }) => backlog.postWatchingListItem({ issueIdOrKey, note, }),
- src/tools/addWatching.ts:7-21 (schema)Zod schema definition for the input parameters of the add_watching tool: issueIdOrKey (number or string) and optional note (string).const addWatchingSchema = buildToolSchema((t) => ({ issueIdOrKey: z .union([z.number(), z.string()]) .describe( t( 'TOOL_ADD_WATCHING_ISSUE_ID_OR_KEY', 'Issue ID or issue key (e.g., 1234 or "PROJECT-123")' ) ), note: z .string() .describe(t('TOOL_ADD_WATCHING_NOTE', 'Optional note for the watch')) .optional() .default(''), }));
- src/tools/tools.ts:108-108 (registration)Instantiation and registration of the addWatchingTool in the 'issue' toolset group within the allTools function.addWatchingTool(backlog, helper),
- src/tools/addWatching.ts:23-44 (helper)Factory function that constructs the complete ToolDefinition for the 'add_watching' tool, including name, description, schemas, and handler.export const addWatchingTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof addWatchingSchema>, (typeof WatchingListItemSchema)['shape'] > => { return { name: 'add_watching', description: t( 'TOOL_ADD_WATCHING_DESCRIPTION', 'Adds a new watch to an issue' ), schema: z.object(addWatchingSchema(t)), outputSchema: WatchingListItemSchema, handler: async ({ issueIdOrKey, note }) => backlog.postWatchingListItem({ issueIdOrKey, note, }), }; };