get_users
Retrieve all users in your Backlog space. Specify an optional organization to filter results.
Instructions
Returns list of users in the Backlog space
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organization | No | Optional organization name. Use list_organizations to inspect available organizations. |
Implementation Reference
- src/tools/getUsers.ts:9-27 (handler)The actual handler function for the 'get_users' tool. It calls backlog.getUsers() to return the list of users in the Backlog space.
export const getUsersTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof getUsersSchema>, (typeof UserSchema)['shape'] > => { return { name: 'get_users', description: t( 'TOOL_GET_USERS_DESCRIPTION', 'Returns list of users in the Backlog space' ), schema: z.object(getUsersSchema(t)), outputSchema: UserSchema, importantFields: ['userId', 'name', 'roleType', 'lang'], handler: async () => backlog.getUsers(), }; }; - The output schema (UserSchema) defining the shape of each user object returned by get_users (id, userId, name, roleType, lang, mailAddress, lastLoginTime).
export const UserSchema = z.object({ id: z.number(), userId: z.string(), name: z.string(), roleType: RoleTypeSchema, lang: LanguageSchema, mailAddress: z.string(), lastLoginTime: z.string(), }); - src/tools/getUsers.ts:7-7 (schema)Input schema for get_users — empty object, meaning no input parameters are required.
const getUsersSchema = buildToolSchema((_t) => ({})); - src/tools/tools.ts:36-77 (registration)Import and registration of getUsersTool in the 'space' toolset within the allTools function.
import { getUsersTool } from './getUsers.js'; import { getUserRecentUpdatesTool } from './getUserRecentUpdates.js'; import { getWatchingListCountTool } from './getWatchingListCount.js'; import { getWatchingListItemsTool } from './getWatchingListItems.js'; import { addWatchingTool } from './addWatching.js'; import { updateWatchingTool } from './updateWatching.js'; import { deleteWatchingTool } from './deleteWatching.js'; import { markWatchingAsReadTool } from './markWatchingAsRead.js'; import { getWikiTool } from './getWiki.js'; import { getWikiPagesTool } from './getWikiPages.js'; import { getWikisCountTool } from './getWikisCount.js'; import { markNotificationAsReadTool } from './markNotificationAsRead.js'; import { resetUnreadNotificationCountTool } from './resetUnreadNotificationCount.js'; import { updateIssueTool } from './updateIssue.js'; import { updateProjectTool } from './updateProject.js'; import { updatePullRequestTool } from './updatePullRequest.js'; import { updatePullRequestCommentTool } from './updatePullRequestComment.js'; import { getDocumentTool } from './getDocument.js'; import { getDocumentsTool } from './getDocuments.js'; import { getDocumentTreeTool } from './getDocumentTree.js'; import { getVersionMilestoneListTool } from './getVersionMilestoneList.js'; import { addVersionMilestoneTool } from './addVersionMilestone.js'; import { updateVersionMilestoneTool } from './updateVersionMilestone.js'; import { deleteVersionTool } from './deleteVersion.js'; import { addDocumentTool } from './addDocument.js'; export const allTools = ( backlog: Backlog, helper: TranslationHelper ): ToolsetGroup => { return { toolsets: [ { name: 'space', description: 'Tools for managing Backlog space settings and general information.', enabled: false, tools: [ getSpaceTool(backlog, helper), getSpaceActivitiesTool(backlog, helper), getUsersTool(backlog, helper), getUserStarsCountTool(backlog, helper), - src/types/tool.ts:24-26 (helper)The buildToolSchema helper used to define the input schema for get_users.
export const buildToolSchema = <T extends z.ZodRawShape>( fn: (t: TranslationHelper['t']) => T ) => fn;