Skip to main content
Glama
imrnbeg

Jira MCP Server

by imrnbeg

List Board Sprints

list_board_sprints

Retrieve sprints for a Jira board with filtering options for active, future, or closed states. Supports pagination to manage large result sets.

Instructions

List sprints for a given board with optional state filter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
boardIdYesBoard ID
stateNoSprint state filter
startAtNoPagination start index (default 0)
maxResultsNoPage size (1-100, default 50)

Implementation Reference

  • src/server.ts:376-407 (registration)
    Registration of the 'list_board_sprints' MCP tool, including schema and inline handler implementation.
    mcp.registerTool(
      "list_board_sprints",
      {
        title: "List Board Sprints",
        description: "List sprints for a given board with optional state filter.",
        inputSchema: {
          boardId: z.number().int().describe("Board ID"),
          state: z.enum(["active","future","closed"]).optional().describe("Sprint state filter"),
          startAt: z.number().int().min(0).optional().describe("Pagination start index (default 0)"),
          maxResults: z.number().int().min(1).max(100).optional().describe("Page size (1-100, default 50)"),
        },
      },
      async (args: { boardId: number; state?: "active"|"future"|"closed"; startAt?: number; maxResults?: number }) => {
        try {
          const params = new URLSearchParams();
          if (args.state) params.set("state", args.state);
          if (typeof args.startAt === "number") params.set("startAt", String(args.startAt));
          if (typeof args.maxResults === "number") params.set("maxResults", String(args.maxResults));
          const url = `${JIRA_URL}/rest/agile/1.0/board/${args.boardId}/sprint${params.toString() ? `?${params.toString()}` : ""}`;
          const response = await fetch(url, { method: "GET", headers: getJiraHeaders() });
          if (!response.ok) {
            const errorText = await response.text();
            return { content: [{ type: "text", text: `Failed to list sprints for board ${args.boardId}: ${response.status} ${response.statusText}\n${errorText}` }], isError: true };
          }
          const data = await response.json() as any;
          const sprints = (data.values || []).map((s: any) => ({ id: s.id, name: s.name, state: s.state, startDate: s.startDate, endDate: s.endDate, completeDate: s.completeDate }));
          return { content: [{ type: "text", text: `Found ${data.total ?? sprints.length} sprints (showing ${sprints.length}).` }], structuredContent: { total: data.total ?? sprints.length, startAt: data.startAt ?? 0, maxResults: data.maxResults ?? sprints.length, boardId: args.boardId, sprints, raw: data } };
        } catch (error) {
          return { content: [{ type: "text", text: `Error listing sprints for board ${args.boardId}: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
  • Handler function that fetches and processes sprints for a specified Jira board using the REST Agile API, handling pagination and errors.
    async (args: { boardId: number; state?: "active"|"future"|"closed"; startAt?: number; maxResults?: number }) => {
      try {
        const params = new URLSearchParams();
        if (args.state) params.set("state", args.state);
        if (typeof args.startAt === "number") params.set("startAt", String(args.startAt));
        if (typeof args.maxResults === "number") params.set("maxResults", String(args.maxResults));
        const url = `${JIRA_URL}/rest/agile/1.0/board/${args.boardId}/sprint${params.toString() ? `?${params.toString()}` : ""}`;
        const response = await fetch(url, { method: "GET", headers: getJiraHeaders() });
        if (!response.ok) {
          const errorText = await response.text();
          return { content: [{ type: "text", text: `Failed to list sprints for board ${args.boardId}: ${response.status} ${response.statusText}\n${errorText}` }], isError: true };
        }
        const data = await response.json() as any;
        const sprints = (data.values || []).map((s: any) => ({ id: s.id, name: s.name, state: s.state, startDate: s.startDate, endDate: s.endDate, completeDate: s.completeDate }));
        return { content: [{ type: "text", text: `Found ${data.total ?? sprints.length} sprints (showing ${sprints.length}).` }], structuredContent: { total: data.total ?? sprints.length, startAt: data.startAt ?? 0, maxResults: data.maxResults ?? sprints.length, boardId: args.boardId, sprints, raw: data } };
      } catch (error) {
        return { content: [{ type: "text", text: `Error listing sprints for board ${args.boardId}: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
      }
    }
  • Input schema definition using Zod for validating tool arguments: board ID, optional state filter, and pagination parameters.
    {
      title: "List Board Sprints",
      description: "List sprints for a given board with optional state filter.",
      inputSchema: {
        boardId: z.number().int().describe("Board ID"),
        state: z.enum(["active","future","closed"]).optional().describe("Sprint state filter"),
        startAt: z.number().int().min(0).optional().describe("Pagination start index (default 0)"),
        maxResults: z.number().int().min(1).max(100).optional().describe("Page size (1-100, default 50)"),
      },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'optional state filter' and implies pagination through parameters, but doesn't describe key behaviors like whether this is a read-only operation, what the output format looks like, error handling, or rate limits. For a tool with 4 parameters and no annotation coverage, this leaves significant gaps in understanding how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that immediately conveys the core functionality. Every word earns its place with no redundancy or unnecessary elaboration. It's appropriately sized for a straightforward listing tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (4 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details about output format, error conditions, or integration with sibling tools. Without annotations or output schema, more behavioral context would be helpful for the agent to use this tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds minimal value beyond the schema by mentioning the 'optional state filter', which is already clear from the schema's enum. It doesn't provide additional context about parameter interactions or usage examples, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List sprints') and target resource ('for a given board'), making the purpose immediately understandable. It distinguishes from siblings like 'list_boards' or 'list_sprint_issues' by focusing specifically on sprints within a board. However, it doesn't explicitly differentiate from potential similar tools beyond the name, keeping it at a 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions an optional state filter but doesn't explain when to apply it or suggest other tools for related tasks like 'list_sprint_issues' or 'search_jira_issues'. There's no context about prerequisites or typical use cases, leaving the agent with minimal direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/imrnbeg/jira-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server