add_watching
Add a watcher to a Backlog issue using its key or ID, with optional note and organization.
Instructions
Adds a new watch to an issue
Input 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 | |
| organization | No | Optional organization name. Use list_organizations to inspect available organizations. |
Implementation Reference
- src/tools/addWatching.ts:23-44 (handler)The main handler function for the 'add_watching' tool. It takes a Backlog client and TranslationHelper, returns a ToolDefinition with name 'add_watching', and the handler calls backlog.postWatchingListItem() with issueIdOrKey and note parameters.
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, }), }; }; - src/tools/addWatching.ts:7-21 (schema)Input schema definition for the 'add_watching' tool. Defines 'issueIdOrKey' (number | string, required) and 'note' (string, optional, defaults to empty 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(''), })); - Output/output schema for the 'add_watching' tool – WatchingListItemSchema. Defines the shape of the response object (id, resourceAlreadyRead, note, type, issue, lastContentUpdated, created, updated).
export const WatchingListItemSchema = z.object({ id: z.number(), resourceAlreadyRead: z.boolean(), note: z.string(), type: z.string(), issue: IssueSchema, lastContentUpdated: z.string(), created: z.string(), updated: z.string(), }); - src/tools/tools.ts:113-123 (registration)Registration of the 'add_watching' tool within the 'issue' toolset. The toolset is named 'issue' and groups issue-related tools together (enabled: false).
getWatchingListItemsTool(backlog, helper), getWatchingListCountTool(backlog, helper), addWatchingTool(backlog, helper), updateWatchingTool(backlog, helper), deleteWatchingTool(backlog, helper), markWatchingAsReadTool(backlog, helper), getVersionMilestoneListTool(backlog, helper), addVersionMilestoneTool(backlog, helper), updateVersionMilestoneTool(backlog, helper), deleteVersionTool(backlog, helper), ],