list_boards
Retrieve boards for a Jira project. Filter by name, type, and paginate results to find the boards you need.
Instructions
List boards from a project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectKeyOrId | Yes | The key or ID of the project | |
| name | No | The name of the boards to return, Must be less than 255 characters. | |
| maxResults | No | The maximum number of results to return, (max: 100) | |
| startAt | No | The starting index of the returned boards | |
| type | No | The type of boards to return |
Implementation Reference
- src/tools/list_boards.ts:40-59 (handler)The main handler function that executes the 'list_boards' tool logic. It constructs a Jira Agile REST API URL with query parameters (projectKeyOrId, name, type, startAt, maxResults), calls $jiraJson to fetch boards, and returns the JSON result or an error.
export async function listBoards(input: ListBoardsInput) { const url = new URL(`/rest/agile/1.0/board`, env.JIRA_BASE_URL); url.searchParams.set("projectKeyOrId", input.projectKeyOrId); if (input.name) url.searchParams.set("name", input.name); if (input.type) url.searchParams.set("type", input.type); if (input.startAt) url.searchParams.set("startAt", input.startAt.toString()); if (input.maxResults) url.searchParams.set("maxResults", input.maxResults.toString()); const json = await $jiraJson(url.toString()); if (json.isErr()) return err(json.error); return ok(json.value); } - src/tools/list_boards.ts:10-30 (schema)Zod schema for validating the 'list_boards' tool input. Defines fields: projectKeyOrId (required string), name (optional string), maxResults (optional number), startAt (optional number), type (optional enum 'scrum'|'kanban').
export const listBoardsInputSchema = z.object({ projectKeyOrId: z.string().describe("The key or ID of the project"), name: z .string() .optional() .describe( "The name of the boards to return, Must be less than 255 characters.", ), maxResults: z .number() .optional() .describe("The maximum number of results to return, (max: 100)"), startAt: z .number() .optional() .describe("The starting index of the returned boards"), type: z .enum(["scrum", "kanban"]) .optional() .describe("The type of boards to return"), }); - src/tools/list_boards.ts:32-36 (registration)Tool definition object LIST_BOARDS_TOOL with name 'list_boards', description 'List boards from a project', and the input schema converted to JSON Schema.
export const LIST_BOARDS_TOOL: Tool = { name: "list_boards", description: "List boards from a project", inputSchema: zodToJsonSchema(listBoardsInputSchema) as Tool["inputSchema"], }; - src/app.ts:39-48 (registration)Registration of LIST_BOARDS_TOOL in the tools array that gets returned via ListToolsRequestSchema handler.
export const tools = [ // list LIST_PROJECTS_TOOL, LIST_BOARDS_TOOL, LIST_SPRINTS_FROM_BOARD_TOOL, LIST_ISSUES_FROM_SPRINT_TOOL, // create CREATE_ISSUE_TOOL, ] satisfies Tool[]; - src/app.ts:115-140 (handler)CallToolRequestSchema handler that routes 'list_boards' calls: parses input, calls listBoards(), and returns the JSON result or an error.
if (name === LIST_BOARDS_TOOL.name) { const input = listBoardsInputSchema.safeParse(args); if (!input.success) { return { isError: true, content: [{ type: "text", text: "Invalid input" }], }; } const result = await listBoards(input.data); if (result.isErr()) { console.error(result.error.message); return { isError: true, content: [{ type: "text", text: "An error occurred" }], }; } return { content: [ { type: "text", text: JSON.stringify(result.value, null, 2) }, ], }; }