jira_get_visible_projects
Retrieve all Jira projects accessible to your account, including project keys, names, descriptions, and metadata. Filter results by recently accessed projects or expand details like issue types and project leads.
Instructions
Retrieves all projects accessible to the authenticated user. Returns project keys, names, descriptions, and basic metadata.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expand | No | Additional project details to include (e.g., ["description", "lead", "issueTypes"]) | |
| recent | No | Limit results to recently accessed projects (max number) |
Implementation Reference
- src/tools/get-visible-projects.ts:38-58 (handler)Main handler function that validates input, fetches visible projects using API helper, formats the response, logs operations, and handles errors.export async function handleGetVisibleProjects(input: any): Promise<McpToolResponse> { try { const validated = validateInput(GetVisibleProjectsInputSchema, input); log.info('Getting visible projects...'); const getParams: any = {}; if (validated.expand !== undefined) getParams.expand = validated.expand; if (validated.recent !== undefined) getParams.recent = validated.recent; const projects = await getVisibleProjects(getParams); log.info(`Found ${projects.length} project(s)`); return formatProjectsResponse(projects); } catch (error) { log.error('Error in handleGetVisibleProjects:', error); return handleError(error); } }
- MCP SDK Tool definition with name, description, and JSON Schema for input validation.export const getVisibleProjectsTool: Tool = { name: TOOL_NAMES.GET_VISIBLE_PROJECTS, description: 'Retrieves all projects accessible to the authenticated user. Returns project keys, names, descriptions, and basic metadata.', inputSchema: { type: 'object', properties: { expand: { type: 'array', items: { type: 'string' }, description: 'Additional project details to include (e.g., ["description", "lead", "issueTypes"])', default: [], }, recent: { type: 'number', description: 'Limit results to recently accessed projects (max number)', minimum: 1, maximum: 100, }, }, required: [], }, };
- src/types/tools.ts:4-10 (schema)Zod schema for input validation used in the handler.// Get visible projects export const GetVisibleProjectsInputSchema = z.object({ expand: z.array(z.string()).optional().describe('Additional project details to include'), recent: z.number().optional().describe('Limit to recently accessed projects'), }); export type GetVisibleProjectsInput = z.infer<typeof GetVisibleProjectsInputSchema>;
- src/index.ts:32-49 (registration)Registration of tool handlers in the server map, mapping tool name to handleGetVisibleProjects.const toolHandlers = new Map<string, (input: unknown) => Promise<any>>([ [TOOL_NAMES.GET_VISIBLE_PROJECTS, tools.handleGetVisibleProjects], [TOOL_NAMES.GET_ISSUE, tools.handleGetIssue], [TOOL_NAMES.SEARCH_ISSUES, tools.handleSearchIssues], [TOOL_NAMES.GET_MY_ISSUES, tools.handleGetMyIssues], [TOOL_NAMES.GET_ISSUE_TYPES, tools.handleGetIssueTypes], [TOOL_NAMES.GET_USERS, tools.handleGetUsers], [TOOL_NAMES.GET_PRIORITIES, tools.handleGetPriorities], [TOOL_NAMES.GET_STATUSES, tools.handleGetStatuses], [TOOL_NAMES.CREATE_ISSUE, tools.handleCreateIssue], [TOOL_NAMES.UPDATE_ISSUE, tools.handleUpdateIssue], [TOOL_NAMES.ADD_COMMENT, tools.handleAddComment], [TOOL_NAMES.GET_PROJECT_INFO, tools.handleGetProjectInfo], [TOOL_NAMES.CREATE_SUBTASK, tools.handleCreateSubtask], [TOOL_NAMES.GET_CREATE_META, tools.handleGetCreateMeta], [TOOL_NAMES.GET_CUSTOM_FIELDS, tools.handleGetCustomFields], [TOOL_NAMES.CREATE_ISSUE_LINK, tools.handleCreateIssueLink], ]);
- src/config/constants.ts:24-25 (registration)Constant definition of the tool name 'jira_get_visible_projects'.export const TOOL_NAMES = { GET_VISIBLE_PROJECTS: 'jira_get_visible_projects',