get_user_recent_updates
Retrieve activities for a user. Apply optional filters such as activity type, ID range, count, and sort order to customize results.
Instructions
Returns recent updates (activities) for a specific user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | ID of the user to retrieve activities for | |
| activityTypeId | No | Activity type IDs to filter by | |
| minId | No | Minimum activity ID | |
| maxId | No | Maximum activity ID | |
| count | No | Number of activities to retrieve (1-100, default: 20) | |
| order | No | Sort order ("asc" or "desc", default: "desc") | desc |
| organization | No | Optional organization name. Use list_organizations to inspect available organizations. |
Implementation Reference
- src/tools/getUserRecentUpdates.ts:60-85 (handler)The handler function that executes the tool logic. It calls backlog.getUserActivities() with the provided parameters.
export const getUserRecentUpdatesTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof getUserRecentUpdatesSchema>, (typeof ActivitySchema)['shape'] > => { return { name: 'get_user_recent_updates', description: t( 'TOOL_GET_USER_RECENT_UPDATES_DESCRIPTION', 'Returns recent updates (activities) for a specific user' ), schema: z.object(getUserRecentUpdatesSchema(t)), outputSchema: ActivitySchema, importantFields: ['id', 'type', 'content', 'created'], handler: async ({ userId, activityTypeId, minId, maxId, count, order }) => backlog.getUserActivities(userId, { activityTypeId, minId, maxId, count, order, }), }; }; - Input schema definition using Zod. Defines parameters: userId (required number), activityTypeId (optional array of ActivityTypeSchema), minId, maxId, count (1-100, default 20), and order ('asc'/'desc', default 'desc').
const getUserRecentUpdatesSchema = buildToolSchema((t) => ({ userId: z .number() .describe( t( 'TOOL_GET_USER_RECENT_UPDATES_USER_ID', 'ID of the user to retrieve activities for' ) ), activityTypeId: z .array(ActivityTypeSchema) .optional() .describe( t( 'TOOL_GET_USER_RECENT_UPDATES_ACTIVITY_TYPE_ID', 'Activity type IDs to filter by' ) ), minId: z .number() .optional() .describe(t('TOOL_GET_USER_RECENT_UPDATES_MIN_ID', 'Minimum activity ID')), maxId: z .number() .optional() .describe(t('TOOL_GET_USER_RECENT_UPDATES_MAX_ID', 'Maximum activity ID')), count: z .number() .min(1) .max(100) .default(20) .optional() .describe( t( 'TOOL_GET_USER_RECENT_UPDATES_COUNT', 'Number of activities to retrieve (1-100, default: 20)' ) ), order: z .enum(['asc', 'desc']) .default('desc') .optional() .describe( t( 'TOOL_GET_USER_RECENT_UPDATES_ORDER', 'Sort order ("asc" or "desc", default: "desc")' ) ), })); - Output schema (ActivitySchema) used as the return type of the tool.
export const ActivitySchema = z.object({ id: z.number(), project: ProjectSchema, type: ActivityTypeSchema, content: z.any(), notifications: z.array(z.any()), createdUser: UserSchema, created: z.string(), }); - src/tools/tools.ts:79-80 (registration)Registration of getUserRecentUpdatesTool in the 'space' toolset within the allTools function.
getUserRecentUpdatesTool(backlog, helper), ], - src/tools/tools.ts:37-37 (registration)Import statement registering the tool module.
import { getUserRecentUpdatesTool } from './getUserRecentUpdates.js';