Skip to main content
Glama

get-upcoming-iterations

Retrieve upcoming project iterations for the current user based on team memberships. Filter results by team ID to streamline planning and project management.

Instructions

Get the upcoming Shortcut iterations for the current user based on their team memberships

Input Schema

NameRequiredDescriptionDefault
teamIdNoThe ID of a team to filter iterations by

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "teamId": { "description": "The ID of a team to filter iterations by", "type": "string" } }, "type": "object" }

Implementation Reference

  • Registration of the tool named 'iterations-get-upcoming' (matches 'get-upcoming-iterations' intent) in IterationTools.create method.
    server.addToolWithReadAccess( "iterations-get-upcoming", "Get the upcoming Shortcut iterations for the current user based on their team memberships", { teamId: z.string().optional().describe("The ID of a team to filter iterations by"), }, async ({ teamId }) => await tools.getUpcomingIterations(teamId), );
  • Input schema definition using Zod: optional teamId string.
    { teamId: z.string().optional().describe("The ID of a team to filter iterations by"), },
  • The handler function getUpcomingIterations that implements the core logic: fetches upcoming iterations via client.getUpcomingIteration for a team or current user's teams, formats response.
    async getUpcomingIterations(teamId?: string) { if (teamId) { const team = await this.client.getTeam(teamId); if (!team) throw new Error(`No team found matching id: "${teamId}"`); const result = await this.client.getUpcomingIteration([teamId]); const iterations = result.get(teamId); if (!iterations?.length) return this.toResult(`Result: No upcoming iterations found for team.`); if (iterations.length === 1) return this.toResult( "The next upcoming iteration for the team is:", await this.entityWithRelatedEntities(iterations[0], "iteration"), ); return this.toResult( "The next upcoming iterations for the team are:", await this.entitiesWithRelatedEntities(iterations, "iterations"), ); } const currentUser = await this.client.getCurrentUser(); if (!currentUser) throw new Error("Failed to retrieve current user."); const teams = await this.client.getTeams(); const teamIds = teams .filter((team) => team.member_ids.includes(currentUser.id)) .map((team) => team.id); if (!teamIds.length) throw new Error("Current user does not belong to any teams."); const resultsByTeam = await this.client.getUpcomingIteration(teamIds); const allUpcomingIterations = [...resultsByTeam.values()].flat(); if (!allUpcomingIterations.length) return this.toResult("Result: No upcoming iterations found for any of your teams."); return this.toResult( "The upcoming iterations for all your teams are:", await this.entitiesWithRelatedEntities(allUpcomingIterations, "iterations"), ); }

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/useshortcut/mcp-server-shortcut'

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