get_iteration_configuration
Retrieve iteration field configuration for GitHub Projects, including duration, start dates, and iteration lists to manage sprints and project timelines.
Instructions
Get iteration field configuration including duration, start date, and list of all iterations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | ||
| fieldName | No |
Implementation Reference
- Core handler function that retrieves iteration field configuration for a GitHub project, including duration, start day, and list of iterations. Fetches project fields, locates the iteration field, and extracts configuration.async getIterationConfiguration(data: { projectId: string; fieldName?: string; }): Promise<{ fieldId: string; fieldName: string; duration: number; startDay: number; iterations: Array<{ id: string; title: string; startDate: string; duration: number; }>; }> { try { const fields = await this.listProjectFields({ projectId: data.projectId }); // Find iteration field const iterationField = fields.find((f: CustomField) => f.type === 'iteration' && (!data.fieldName || f.name === data.fieldName) ); if (!iterationField) { throw new ResourceNotFoundError( ResourceType.FIELD, data.fieldName || 'iteration field' ); } if (!iterationField.config) { throw new Error('Invalid iteration field configuration'); } return { fieldId: iterationField.id, fieldName: iterationField.name, duration: iterationField.config.iterationDuration || 14, startDay: iterationField.config.iterationStart ? new Date(iterationField.config.iterationStart).getDay() : 1, iterations: (iterationField.config.iterations || []).map((iter: any) => ({ id: iter.id, title: iter.title, startDate: iter.startDate, duration: iter.duration })) }; } catch (error) { throw this.mapErrorToMCPError(error); } }
- Zod input schema validation (projectId required, fieldName optional) and ToolDefinition with name, description, examples for get_iteration_configuration tool.export const getIterationConfigurationSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), fieldName: z.string().optional() }); export type GetIterationConfigurationArgs = z.infer<typeof getIterationConfigurationSchema>; // Schema for get_current_iteration tool export const getCurrentIterationSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), fieldName: z.string().optional() }); export type GetCurrentIterationArgs = z.infer<typeof getCurrentIterationSchema>; // Schema for get_iteration_items tool export const getIterationItemsSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), iterationId: z.string().min(1, "Iteration ID is required"), limit: z.number().int().positive().default(50).optional() }); export type GetIterationItemsArgs = z.infer<typeof getIterationItemsSchema>; // Schema for get_iteration_by_date tool export const getIterationByDateSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), date: z.string().datetime("Date must be a valid ISO date string"), fieldName: z.string().optional() }); export type GetIterationByDateArgs = z.infer<typeof getIterationByDateSchema>; // Schema for assign_items_to_iteration tool export const assignItemsToIterationSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), itemIds: z.array(z.string()).min(1, "At least one item ID is required"), iterationId: z.string().min(1, "Iteration ID is required"), fieldName: z.string().optional() }); export type AssignItemsToIterationArgs = z.infer<typeof assignItemsToIterationSchema>; // ============================================================================ // AI-Powered Automation Tools // ============================================================================ // Schema for generate_roadmap tool export const generateRoadmapSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), projectTitle: z.string().min(1, "Project title is required"), projectDescription: z.string().optional(), sprintDurationWeeks: z.number().int().positive().default(2).optional(), targetMilestones: z.number().int().positive().default(4).optional(), autoCreate: z.boolean().default(false).optional() }); export type GenerateRoadmapArgs = z.infer<typeof generateRoadmapSchema>; // Schema for enrich_issue tool export const enrichIssueSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), issueId: z.string().min(1, "Issue ID is required"), issueNumber: z.number().int().positive(), issueTitle: z.string().min(1, "Issue title is required"), issueDescription: z.string().optional(), projectContext: z.string().optional(), autoApply: z.boolean().default(false).optional() }); export type EnrichIssueArgs = z.infer<typeof enrichIssueSchema>; // Schema for enrich_issues_bulk tool export const enrichIssuesBulkSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), issueIds: z.array(z.string()).optional(), projectContext: z.string().optional(), autoApply: z.boolean().default(false).optional() }); export type EnrichIssuesBulkArgs = z.infer<typeof enrichIssuesBulkSchema>; // Schema for triage_issue tool export const triageIssueSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), issueId: z.string().min(1, "Issue ID is required"), issueNumber: z.number().int().positive(), issueTitle: z.string().min(1, "Issue title is required"), issueDescription: z.string().optional(), projectContext: z.string().optional(), autoApply: z.boolean().default(false).optional() }); export type TriageIssueArgs = z.infer<typeof triageIssueSchema>; // Schema for triage_all_issues tool export const triageAllIssuesSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), onlyUntriaged: z.boolean().default(true).optional(), autoApply: z.boolean().default(false).optional(), projectContext: z.string().optional() }); export type TriageAllIssuesArgs = z.infer<typeof triageAllIssuesSchema>; // Schema for schedule_triaging tool export const scheduleTriagingSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), schedule: z.enum(['hourly', 'daily', 'weekly']), autoApply: z.boolean().default(false) }); export type ScheduleTriagingArgs = z.infer<typeof scheduleTriagingSchema>; // Project tools export const updateProjectTool: ToolDefinition<UpdateProjectArgs> = { name: "update_project", description: "Update an existing GitHub project", schema: updateProjectSchema as unknown as ToolSchema<UpdateProjectArgs>, examples: [ { name: "Update project title and visibility", description: "Change a project's title and make it public", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", title: "Updated API Development", visibility: "public" } }, { name: "Close a project", description: "Mark a project as closed", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", status: "closed" } } ] }; export const deleteProjectTool: ToolDefinition<DeleteProjectArgs> = { name: "delete_project", description: "Delete a GitHub project", schema: deleteProjectSchema as unknown as ToolSchema<DeleteProjectArgs>, examples: [ { name: "Delete project", description: "Delete a GitHub project by ID", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH" } } ] }; export const getProjectReadmeTool: ToolDefinition<GetProjectReadmeArgs> = { name: "get_project_readme", description: "Get the README content of a GitHub project", schema: getProjectReadmeSchema as unknown as ToolSchema<GetProjectReadmeArgs>, examples: [ { name: "Get project README", description: "Retrieve the README for a project", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH" } } ] }; export const updateProjectReadmeTool: ToolDefinition<UpdateProjectReadmeArgs> = { name: "update_project_readme", description: "Update the README content of a GitHub project", schema: updateProjectReadmeSchema as unknown as ToolSchema<UpdateProjectReadmeArgs>, examples: [ { name: "Set project README", description: "Update the project README with documentation", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", readme: "# Project Overview\n\nThis project tracks our development roadmap..." } } ] }; export const listProjectFieldsTool: ToolDefinition<ListProjectFieldsArgs> = { name: "list_project_fields", description: "List all fields in a GitHub project", schema: listProjectFieldsSchema as unknown as ToolSchema<ListProjectFieldsArgs>, examples: [ { name: "List project fields", description: "Get all fields for a specific project", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH" } } ] }; export const updateProjectFieldTool: ToolDefinition<UpdateProjectFieldArgs> = { name: "update_project_field", description: "Update a custom field in a GitHub project", schema: updateProjectFieldSchema as unknown as ToolSchema<UpdateProjectFieldArgs>, examples: [ { name: "Update field options", description: "Update options for a single-select field", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI1", name: "Updated Status", options: [ { name: "Not Started", color: "red" }, { name: "In Progress", color: "yellow" }, { name: "Review", color: "blue" }, { name: "Complete", color: "green" } ] } } ] }; export const addProjectItemTool: ToolDefinition<AddProjectItemArgs> = { name: "add_project_item", description: "Add an item to a GitHub project", schema: addProjectItemSchema as unknown as ToolSchema<AddProjectItemArgs>, examples: [ { name: "Add issue to project", description: "Add an existing issue to a project", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", contentId: "I_kwDOJrIzLs5eGXAT", contentType: "issue" } } ] }; export const removeProjectItemTool: ToolDefinition<RemoveProjectItemArgs> = { name: "remove_project_item", description: "Remove an item from a GitHub project", schema: removeProjectItemSchema as unknown as ToolSchema<RemoveProjectItemArgs>, examples: [ { name: "Remove item from project", description: "Remove an item from a project", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7" } } ] }; export const listProjectItemsTool: ToolDefinition<ListProjectItemsArgs> = { name: "list_project_items", description: "List all items in a GitHub project", schema: listProjectItemsSchema as unknown as ToolSchema<ListProjectItemsArgs>, examples: [ { name: "List project items", description: "Get all items in a project with limit", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", limit: 20 } } ] }; export const archiveProjectItemTool: ToolDefinition<ArchiveProjectItemArgs> = { name: "archive_project_item", description: "Archive an item in a GitHub project. Archived items are hidden from views but not deleted.", schema: archiveProjectItemSchema as unknown as ToolSchema<ArchiveProjectItemArgs>, examples: [ { name: "Archive completed task", description: "Archive a project item that is complete", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7" } } ] }; export const unarchiveProjectItemTool: ToolDefinition<UnarchiveProjectItemArgs> = { name: "unarchive_project_item", description: "Unarchive an item in a GitHub project. Brings back a previously archived item.", schema: unarchiveProjectItemSchema as unknown as ToolSchema<UnarchiveProjectItemArgs>, examples: [ { name: "Unarchive task", description: "Restore an archived project item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7" } } ] }; export const setFieldValueTool: ToolDefinition<SetFieldValueArgs> = { name: "set_field_value", description: "Set a field value for a GitHub project item. Supports all field types: TEXT, NUMBER, DATE, SINGLE_SELECT, ITERATION, MILESTONE, ASSIGNEES, LABELS", schema: setFieldValueSchema as unknown as ToolSchema<SetFieldValueArgs>, examples: [ { name: "Set text field value", description: "Set a text field value for a project item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI1", value: "Updated task description" } }, { name: "Set number field value", description: "Set a number field (e.g., story points) for a project item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI2", value: 8 } }, { name: "Set date field value", description: "Set a date field for a project item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI3", value: "2025-06-15" } }, { name: "Set single select field value", description: "Set status field value for a project item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI4", value: "In Progress" } }, { name: "Set iteration field value", description: "Assign a project item to a specific iteration/sprint", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI5", value: "PVTI_kwDOLhQ7gc4AOEbHzM4AOAIter1" } }, { name: "Set milestone field value", description: "Assign a project item to a specific milestone", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI6", value: "MI_kwDOLhQ7gc4AOEbHzM4AOAMile1" } }, { name: "Set assignees field value", description: "Assign multiple users to a project item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI7", value: ["MDQ6VXNlcjEyMzQ1Njc4", "MDQ6VXNlcjg3NjU0MzIx"] } }, { name: "Set single assignee field value", description: "Assign a single user to a project item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI7", value: "MDQ6VXNlcjEyMzQ1Njc4" } }, { name: "Set labels field value", description: "Assign multiple labels to a project item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI8", value: ["LA_kwDOLhQ7gc4AOEbHzM4AOAL1", "LA_kwDOLhQ7gc4AOEbHzM4AOAL2"] } }, { name: "Set single label field value", description: "Assign a single label to a project item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI8", value: "LA_kwDOLhQ7gc4AOEbHzM4AOAL1" } } ] }; export const getFieldValueTool: ToolDefinition<GetFieldValueArgs> = { name: "get_field_value", description: "Get a field value for a GitHub project item. Supports reading all field types: TEXT, NUMBER, DATE, SINGLE_SELECT, ITERATION, MILESTONE, ASSIGNEES, LABELS", schema: getFieldValueSchema as unknown as ToolSchema<GetFieldValueArgs>, examples: [ { name: "Get text field value", description: "Get the current text value for an item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI1" } }, { name: "Get status field value", description: "Get the current status (single select) value for an item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI2" } }, { name: "Get iteration field value", description: "Get the current iteration/sprint assignment for an item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI3" } }, { name: "Get milestone field value", description: "Get the current milestone assignment for an item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI4" } }, { name: "Get assignees field value", description: "Get the current assignees for an item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI5" } }, { name: "Get labels field value", description: "Get the current labels for an item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI6" } } ] }; export const clearFieldValueTool: ToolDefinition<ClearFieldValueArgs> = { name: "clear_field_value", description: "Clear a field value for a GitHub project item. This removes/clears the value for any field type.", schema: clearFieldValueSchema as unknown as ToolSchema<ClearFieldValueArgs>, examples: [ { name: "Clear status field", description: "Clear the status field for an item", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI1" } }, { name: "Clear iteration assignment", description: "Remove an item from its current iteration/sprint", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7", fieldId: "PVTF_lADOLhQ7gc4AOEbHzM4AOAI2" } } ] }; export const listProjectViewsTool: ToolDefinition<ListProjectViewsArgs> = { name: "list_project_views", description: "List all views in a GitHub project", schema: listProjectViewsSchema as unknown as ToolSchema<ListProjectViewsArgs>, examples: [ { name: "List project views", description: "Get all views for a specific project", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH" } } ] }; export const updateProjectViewTool: ToolDefinition<UpdateProjectViewArgs> = { name: "update_project_view", description: "Update a view in a GitHub project", schema: updateProjectViewSchema as unknown as ToolSchema<UpdateProjectViewArgs>, examples: [ { name: "Update view to timeline", description: "Change a view's name and layout to timeline", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", viewId: "PVV_lADOLhQ7gc4AOEbHzM4AOAL9", name: "Development Timeline", layout: "timeline" } } ] }; export const deleteProjectViewTool: ToolDefinition<DeleteProjectViewArgs> = { name: "delete_project_view", description: "Delete a view from a GitHub project", schema: deleteProjectViewSchema as unknown as ToolSchema<DeleteProjectViewArgs>, examples: [ { name: "Delete project view", description: "Delete a specific view from a project", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", viewId: "PVV_lADOLhQ7gc4AOEbHzM4AOAL9" } } ] }; export const updateMilestoneTool: ToolDefinition<UpdateMilestoneArgs> = { name: "update_milestone", description: "Update a GitHub milestone", schema: updateMilestoneSchema as unknown as ToolSchema<UpdateMilestoneArgs>, examples: [ { name: "Update milestone due date", description: "Change a milestone's title and due date", args: { milestoneId: "42", title: "Updated Release", dueDate: "2025-08-15T00:00:00Z" } }, { name: "Close milestone", description: "Mark a milestone as closed", args: { milestoneId: "42", state: "closed" } } ] }; export const deleteMilestoneTool: ToolDefinition<DeleteMilestoneArgs> = { name: "delete_milestone", description: "Delete a GitHub milestone", schema: deleteMilestoneSchema as unknown as ToolSchema<DeleteMilestoneArgs>, examples: [ { name: "Delete milestone", description: "Delete a milestone by ID", args: { milestoneId: "42" } } ] }; export const updateSprintTool: ToolDefinition<UpdateSprintArgs> = { name: "update_sprint", description: "Update a development sprint", schema: updateSprintSchema as unknown as ToolSchema<UpdateSprintArgs>, examples: [ { name: "Update sprint dates", description: "Update sprint dates and status", args: { sprintId: "sprint_1", startDate: "2025-07-01T00:00:00Z", endDate: "2025-07-15T00:00:00Z", status: "active" } } ] }; export const addIssuesToSprintTool: ToolDefinition<AddIssuesToSprintArgs> = { name: "add_issues_to_sprint", description: "Add issues to an existing sprint", schema: addIssuesToSprintSchema as unknown as ToolSchema<AddIssuesToSprintArgs>, examples: [ { name: "Add issues to sprint", description: "Add multiple issues to an existing sprint", args: { sprintId: "sprint_1", issueIds: ["123", "124", "125"] } } ] }; export const removeIssuesFromSprintTool: ToolDefinition<RemoveIssuesFromSprintArgs> = { name: "remove_issues_from_sprint", description: "Remove issues from a sprint", schema: removeIssuesFromSprintSchema as unknown as ToolSchema<RemoveIssuesFromSprintArgs>, examples: [ { name: "Remove issues from sprint", description: "Remove issues that are no longer in scope for the sprint", args: { sprintId: "sprint_1", issueIds: ["124", "125"] } } ] }; export const createLabelTool: ToolDefinition<CreateLabelArgs> = { name: "create_label", description: "Create a new GitHub label", schema: createLabelSchema as unknown as ToolSchema<CreateLabelArgs>, examples: [ { name: "Create bug label", description: "Create a red bug label", args: { name: "bug", color: "ff0000", description: "Something isn't working" } } ] }; export const listLabelsTool: ToolDefinition<ListLabelsArgs> = { name: "list_labels", description: "List all GitHub labels", schema: listLabelsSchema as unknown as ToolSchema<ListLabelsArgs>, examples: [ { name: "List all labels", description: "Get all repository labels", args: { limit: 50 } } ] }; // Event management schemas export const subscribeToEventsSchema = z.object({ clientId: z.string().min(1, "Client ID is required"), filters: z.array( z.object({ resourceType: z.enum(["PROJECT", "MILESTONE", "ISSUE", "SPRINT"]).optional(), eventType: z.enum(["created", "updated", "deleted", "closed", "reopened"]).optional(), resourceId: z.string().optional(), source: z.enum(["github", "api"]).optional(), tags: z.array(z.string()).optional(), }) ).default([]), transport: z.enum(["sse", "webhook", "internal"]).default("sse"), endpoint: z.string().optional(), expiresAt: z.string().datetime().optional(), }); export type SubscribeToEventsArgs = z.infer<typeof subscribeToEventsSchema>; export const getRecentEventsSchema = z.object({ resourceType: z.enum(["PROJECT", "MILESTONE", "ISSUE", "SPRINT"]).optional(), resourceId: z.string().optional(), eventType: z.enum(["created", "updated", "deleted", "closed", "reopened"]).optional(), limit: z.number().int().positive().default(100).optional(), }); export type GetRecentEventsArgs = z.infer<typeof getRecentEventsSchema>; export const replayEventsSchema = z.object({ fromTimestamp: z.string().datetime("From timestamp must be a valid ISO date string"), toTimestamp: z.string().datetime().optional(), resourceType: z.enum(["PROJECT", "MILESTONE", "ISSUE", "SPRINT"]).optional(), resourceId: z.string().optional(), limit: z.number().int().positive().default(1000).optional(), }); export type ReplayEventsArgs = z.infer<typeof replayEventsSchema>; // Event management tool definitions export const subscribeToEventsTool: ToolDefinition<SubscribeToEventsArgs> = { name: "subscribe_to_events", description: "Subscribe to real-time events for GitHub resources", schema: subscribeToEventsSchema as unknown as ToolSchema<SubscribeToEventsArgs>, examples: [ { name: "Subscribe to all project events", description: "Subscribe to all events for projects", args: { clientId: "my-client", filters: [{ resourceType: "PROJECT" }], transport: "sse" } }, { name: "Subscribe to issue updates", description: "Subscribe to update events for a specific issue", args: { clientId: "my-client", filters: [{ resourceType: "ISSUE", eventType: "updated", resourceId: "123" }], transport: "sse" } } ] }; export const getRecentEventsTool: ToolDefinition<GetRecentEventsArgs> = { name: "get_recent_events", description: "Get recent events for GitHub resources", schema: getRecentEventsSchema as unknown as ToolSchema<GetRecentEventsArgs>, examples: [ { name: "Get recent project events", description: "Get the last 50 events for projects", args: { resourceType: "PROJECT", limit: 50 } }, { name: "Get recent events for specific issue", description: "Get recent events for a specific issue", args: { resourceType: "ISSUE", resourceId: "123", limit: 20 } } ] }; export const replayEventsTool: ToolDefinition<ReplayEventsArgs> = { name: "replay_events", description: "Replay events from a specific timestamp", schema: replayEventsSchema as unknown as ToolSchema<ReplayEventsArgs>, examples: [ { name: "Replay events from yesterday", description: "Replay all events from yesterday", args: { fromTimestamp: "2025-01-01T00:00:00Z", limit: 500 } }, { name: "Replay project events from specific time", description: "Replay project events from a specific timestamp", args: { fromTimestamp: "2025-01-01T12:00:00Z", resourceType: "PROJECT", limit: 100 } } ] }; // ============================================================================ // Automation Service Tool Definitions // ============================================================================ export const createAutomationRuleTool: ToolDefinition<CreateAutomationRuleArgs> = { name: "create_automation_rule", description: "Create a new automation rule for a GitHub project", schema: createAutomationRuleSchema as unknown as ToolSchema<CreateAutomationRuleArgs>, examples: [ { name: "Auto-label PRs", description: "Automatically add 'needs-review' label when PR is opened", args: { name: "Auto-label new PRs", projectId: "PVT_kwDOLhQ7gc4AOEbH", enabled: true, triggers: [{ type: "pr_opened" }], actions: [{ type: "add_label", parameters: { labelName: "needs-review" } }] } }, { name: "Auto-assign issues", description: "Automatically assign issues with 'bug' label to maintainer", args: { name: "Auto-assign bugs", projectId: "PVT_kwDOLhQ7gc4AOEbH", enabled: true, triggers: [{ type: "issue_labeled", conditions: [{ field: "label", operator: "equals", value: "bug" }] }], actions: [{ type: "assign_user", parameters: { username: "maintainer" } }] } } ] }; export const updateAutomationRuleTool: ToolDefinition<UpdateAutomationRuleArgs> = { name: "update_automation_rule", description: "Update an existing automation rule", schema: updateAutomationRuleSchema as unknown as ToolSchema<UpdateAutomationRuleArgs>, examples: [ { name: "Update rule name", description: "Change the name of an automation rule", args: { ruleId: "AR_kwDOLhQ7gc4AOEbH", name: "Updated rule name" } }, { name: "Disable rule temporarily", description: "Disable an automation rule without deleting it", args: { ruleId: "AR_kwDOLhQ7gc4AOEbH", enabled: false } } ] }; export const deleteAutomationRuleTool: ToolDefinition<DeleteAutomationRuleArgs> = { name: "delete_automation_rule", description: "Delete an automation rule from a project", schema: deleteAutomationRuleSchema as unknown as ToolSchema<DeleteAutomationRuleArgs>, examples: [ { name: "Delete rule", description: "Remove an automation rule from a project", args: { ruleId: "AR_kwDOLhQ7gc4AOEbH" } } ] }; export const getAutomationRuleTool: ToolDefinition<GetAutomationRuleArgs> = { name: "get_automation_rule", description: "Get details of a specific automation rule", schema: getAutomationRuleSchema as unknown as ToolSchema<GetAutomationRuleArgs>, examples: [ { name: "Get rule details", description: "Retrieve details of an automation rule", args: { ruleId: "AR_kwDOLhQ7gc4AOEbH" } } ] }; export const listAutomationRulesTool: ToolDefinition<ListAutomationRulesArgs> = { name: "list_automation_rules", description: "List all automation rules for a GitHub project", schema: listAutomationRulesSchema as unknown as ToolSchema<ListAutomationRulesArgs>, examples: [ { name: "List project rules", description: "Get all automation rules for a project", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH" } } ] }; export const enableAutomationRuleTool: ToolDefinition<EnableAutomationRuleArgs> = { name: "enable_automation_rule", description: "Enable a disabled automation rule", schema: enableAutomationRuleSchema as unknown as ToolSchema<EnableAutomationRuleArgs>, examples: [ { name: "Enable rule", description: "Re-enable a disabled automation rule", args: { ruleId: "AR_kwDOLhQ7gc4AOEbH" } } ] }; export const disableAutomationRuleTool: ToolDefinition<DisableAutomationRuleArgs> = { name: "disable_automation_rule", description: "Disable an automation rule without deleting it", schema: disableAutomationRuleSchema as unknown as ToolSchema<DisableAutomationRuleArgs>, examples: [ { name: "Disable rule", description: "Temporarily disable an automation rule", args: { ruleId: "AR_kwDOLhQ7gc4AOEbH" } } ] }; // ============================================================================ // Iteration Management Tool Definitions // ============================================================================ export const getIterationConfigurationTool: ToolDefinition<GetIterationConfigurationArgs> = { name: "get_iteration_configuration", description: "Get iteration field configuration including duration, start date, and list of all iterations", schema: getIterationConfigurationSchema as unknown as ToolSchema<GetIterationConfigurationArgs>, examples: [ { name: "Get iteration config", description: "Get all iterations for a project", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH" } } ] };
- src/infrastructure/tools/ToolRegistry.ts:104-288 (registration)Import of getIterationConfigurationTool from ToolSchemas.ts and registration in ToolRegistry singleton instance.getIterationConfigurationTool, getCurrentIterationTool, getIterationItemsTool, getIterationByDateTool, assignItemsToIterationTool, // AI-powered automation tools generateRoadmapTool, enrichIssueTool, enrichIssuesBulkTool, triageIssueTool, triageAllIssuesTool, scheduleTriagingTool, } from "./ToolSchemas.js"; /** * Central registry of all available tools */ export class ToolRegistry { private static _instance: ToolRegistry; private _tools: Map<string, ToolDefinition<any>>; private constructor() { this._tools = new Map(); this.registerBuiltInTools(); } /** * Get the singleton instance */ public static getInstance(): ToolRegistry { if (!ToolRegistry._instance) { ToolRegistry._instance = new ToolRegistry(); } return ToolRegistry._instance; } /** * Register a new tool */ public registerTool<T>(tool: ToolDefinition<T>): void { if (this._tools.has(tool.name)) { process.stderr.write(`Tool '${tool.name}' is already registered and will be overwritten.\n`); } this._tools.set(tool.name, tool); } /** * Get a tool by name */ public getTool<T>(name: string): ToolDefinition<T> | undefined { return this._tools.get(name) as ToolDefinition<T> | undefined; } /** * Get all registered tools */ public getAllTools(): ToolDefinition<any>[] { return Array.from(this._tools.values()); } /** * Convert tools to MCP format for list_tools response */ public getToolsForMCP(): Array<{ name: string; description: string; inputSchema: any; }> { return this.getAllTools().map(tool => ({ name: tool.name, description: tool.description, inputSchema: this.convertZodToJsonSchema(tool.schema), })); } /** * Register all built-in tools */ private registerBuiltInTools(): void { // Register roadmap and planning tools this.registerTool(createRoadmapTool); this.registerTool(planSprintTool); this.registerTool(getMilestoneMetricsTool); this.registerTool(getSprintMetricsTool); this.registerTool(getOverdueMilestonesTool); this.registerTool(getUpcomingMilestonesTool); // Register project tools this.registerTool(createProjectTool); this.registerTool(listProjectsTool); this.registerTool(getProjectTool); this.registerTool(updateProjectTool); this.registerTool(deleteProjectTool); this.registerTool(getProjectReadmeTool); this.registerTool(updateProjectReadmeTool); // Register milestone tools this.registerTool(createMilestoneTool); this.registerTool(listMilestonesTool); this.registerTool(updateMilestoneTool); this.registerTool(deleteMilestoneTool); // Register issue tools this.registerTool(createIssueTool); this.registerTool(listIssuesTool); this.registerTool(getIssueTool); this.registerTool(updateIssueTool); // Register issue comment tools this.registerTool(createIssueCommentTool); this.registerTool(updateIssueCommentTool); this.registerTool(deleteIssueCommentTool); this.registerTool(listIssueCommentsTool); // Register draft issue tools this.registerTool(createDraftIssueTool); this.registerTool(updateDraftIssueTool); this.registerTool(deleteDraftIssueTool); // Register pull request tools this.registerTool(createPullRequestTool); this.registerTool(getPullRequestTool); this.registerTool(listPullRequestsTool); this.registerTool(updatePullRequestTool); this.registerTool(mergePullRequestTool); this.registerTool(listPullRequestReviewsTool); this.registerTool(createPullRequestReviewTool); // Register sprint tools this.registerTool(createSprintTool); this.registerTool(listSprintsTool); this.registerTool(getCurrentSprintTool); this.registerTool(updateSprintTool); this.registerTool(addIssuesToSprintTool); this.registerTool(removeIssuesFromSprintTool); // Register project field tools this.registerTool(createProjectFieldTool); this.registerTool(listProjectFieldsTool); this.registerTool(updateProjectFieldTool); // Register project view tools this.registerTool(createProjectViewTool); this.registerTool(listProjectViewsTool); this.registerTool(updateProjectViewTool); this.registerTool(deleteProjectViewTool); // Register project item tools this.registerTool(addProjectItemTool); this.registerTool(removeProjectItemTool); this.registerTool(listProjectItemsTool); this.registerTool(archiveProjectItemTool); this.registerTool(unarchiveProjectItemTool); // Register field value tools this.registerTool(setFieldValueTool); this.registerTool(getFieldValueTool); this.registerTool(clearFieldValueTool); // Register label tools this.registerTool(createLabelTool); this.registerTool(listLabelsTool); // Register AI task management tools this.registerTool(addFeatureTool); this.registerTool(generatePRDTool); this.registerTool(parsePRDTool); this.registerTool(getNextTaskTool); this.registerTool(analyzeTaskComplexityTool); this.registerTool(expandTaskTool); this.registerTool(enhancePRDTool); this.registerTool(createTraceabilityMatrixTool); // Register automation service tools this.registerTool(createAutomationRuleTool); this.registerTool(updateAutomationRuleTool); this.registerTool(deleteAutomationRuleTool); this.registerTool(getAutomationRuleTool); this.registerTool(listAutomationRulesTool); this.registerTool(enableAutomationRuleTool); this.registerTool(disableAutomationRuleTool); // Register iteration management tools this.registerTool(getIterationConfigurationTool);
- src/index.ts:488-489 (handler)MCP server dispatch handler in executeToolHandler switch statement that routes tool calls to ProjectManagementService.getIterationConfiguration.case "get_iteration_configuration": return await this.service.getIterationConfiguration(args);