Documentation
¶
Index ¶
- Variables
- func AddOperation(field string, value any) webapi.JsonPatchOperation
- func ExtractWorkItemIDFromURL(itemURL string) (int, error)
- func FormatStringList(items []string) string
- func GetCurrentSprint(ctx context.Context, workClient work.Client, project string, team string) (map[string]any, error)
- func GetFloat64Arg(req mcp.CallToolRequest, key string) (float64, error)
- func GetIntArg(req mcp.CallToolRequest, key string) (int, error)
- func GetOptionalStringParamWithFallback(req mcp.CallToolRequest, key string, fallbackValue string) string
- func GetStringArg(req mcp.CallToolRequest, key string) (string, error)
- func GetWorkItemURL(orgURL string, workItemID int) string
- func HandleError(err error, message string) *mcp.CallToolResult
- func Min(a, b int) int
- func NewAzureCreateSprintTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
- func NewAzureCreateWorkItemsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
- func NewAzureEnrichWorkItemTool(conn *azuredevops.Connection, globalConfig AzureDevOpsConfig) core.Tool
- func NewAzureExecuteWiqlTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
- func NewAzureFindItemsByStatusTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
- func NewAzureGetGitHubFileContentTool() core.Tool
- func NewAzureGetSprintsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
- func NewAzureGetWorkItemsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
- func NewAzureSearchWorkItemsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
- func NewAzureSprintItemsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
- func NewAzureSprintOverviewTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
- func NewAzureUpdateWorkItemsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
- func NewAzureWorkItemCommentsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
- func ParseIDs(idsStr string) ([]int, error)
- func SafeString(s *string) string
- func StringPtr(s string) *string
- type AzureCreateSprintTool
- type AzureCreateWorkItemsTool
- type AzureDevOpsConfig
- type AzureEnrichWorkItemTool
- type AzureExecuteWiqlTool
- type AzureFindItemsByStatusTool
- type AzureGetGitHubFileContentTool
- type AzureGetSprintsTool
- type AzureGetWorkItemsTool
- type AzureSearchWorkItemsTool
- type AzureSprintItemsTool
- type AzureSprintOverviewTool
- type AzureUpdateWorkItemsTool
- type AzureWorkItemCommentsTool
- type CommentOutput
- type DetailedWorkItemOutput
- type DetailedWorkItemRelationOutput
- type EnrichmentResults
- type GitHubCodeResult
- type GitHubIssueResult
- type RelationLink
- type RelationLinkArgs
- type SearchWorkItemOutput
- type SentryIssueResult
- type SlackMessageResult
- type SprintOutput
- type SprintOverviewOutput
- type SprintWorkItemOutput
- type WorkItemDefinition
- type WorkItemUpdateDefinition
Constants ¶
This section is empty.
Variables ¶
var FieldMap = map[string]string{
"Title": "System.Title",
"Description": "System.Description",
"State": "System.State",
"Priority": "Microsoft.VSTS.Common.Priority",
}
Field name mapping
var RelationTypeMap = map[string]string{
"parent": "System.LinkTypes.Hierarchy-Reverse",
"child": "System.LinkTypes.Hierarchy-Forward",
"children": "System.LinkTypes.Hierarchy-Forward",
"related": "System.LinkTypes.Related",
}
Relation type mapping
Functions ¶
func AddOperation ¶
func AddOperation(field string, value any) webapi.JsonPatchOperation
Helper function to add an operation
func ExtractWorkItemIDFromURL ¶
ExtractWorkItemIDFromURL extracts the work item ID from a standard Azure DevOps work item URL. Example URL: https://dev.azure.com/org/project/_apis/wit/workItems/123 or https://org.visualstudio.com/project/_apis/wit/workItems/123
func FormatStringList ¶
Format a list of strings for WIQL queries
func GetCurrentSprint ¶
func GetCurrentSprint(ctx context.Context, workClient work.Client, project string, team string) (map[string]any, error)
GetCurrentSprint uses the Azure DevOps SDK to get current sprint information.
func GetFloat64Arg ¶
func GetFloat64Arg(req mcp.CallToolRequest, key string) (float64, error)
Helper to extract a float64 argument.
func GetIntArg ¶
func GetIntArg(req mcp.CallToolRequest, key string) (int, error)
Helper to extract an int argument from a float64.
func GetOptionalStringParamWithFallback ¶
func GetOptionalStringParamWithFallback(req mcp.CallToolRequest, key string, fallbackValue string) string
GetOptionalStringParamWithFallback is a helper function. It tries to get a string parameter from the request. If not found or empty, it returns the fallbackValue.
func GetStringArg ¶
func GetStringArg(req mcp.CallToolRequest, key string) (string, error)
Helper to extract a string argument.
func GetWorkItemURL ¶
GetWorkItemURL constructs the UI URL for a work item.
func HandleError ¶
func HandleError(err error, message string) *mcp.CallToolResult
Helper for common error formatting
func NewAzureCreateSprintTool ¶
func NewAzureCreateSprintTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
NewAzureCreateSprintTool creates a new tool instance for creating sprints.
func NewAzureCreateWorkItemsTool ¶
func NewAzureCreateWorkItemsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
NewAzureCreateWorkItemsTool creates a new tool instance for creating work items.
func NewAzureEnrichWorkItemTool ¶
func NewAzureEnrichWorkItemTool(conn *azuredevops.Connection, globalConfig AzureDevOpsConfig) core.Tool
NewAzureEnrichWorkItemTool creates a new tool instance for enriching work items.
func NewAzureExecuteWiqlTool ¶
func NewAzureExecuteWiqlTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
NewAzureExecuteWiqlTool creates a new tool instance for executing WIQL queries.
func NewAzureFindItemsByStatusTool ¶
func NewAzureFindItemsByStatusTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
NewAzureFindItemsByStatusTool creates a new tool instance for finding items by status
func NewAzureGetGitHubFileContentTool ¶
NewAzureGetGitHubFileContentTool creates a new tool instance for retrieving GitHub file content.
func NewAzureGetSprintsTool ¶
func NewAzureGetSprintsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
NewAzureGetSprintsTool creates a new tool instance for listing sprints.
func NewAzureGetWorkItemsTool ¶
func NewAzureGetWorkItemsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
NewAzureGetWorkItemsTool creates a new tool instance for getting work item details
func NewAzureSearchWorkItemsTool ¶
func NewAzureSearchWorkItemsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
NewAzureSearchWorkItemsTool creates a new tool instance for searching work items.
func NewAzureSprintItemsTool ¶
func NewAzureSprintItemsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
NewAzureSprintItemsTool creates a new tool instance for finding items in the current sprint
func NewAzureSprintOverviewTool ¶
func NewAzureSprintOverviewTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
NewAzureSprintOverviewTool creates a new tool instance.
func NewAzureUpdateWorkItemsTool ¶
func NewAzureUpdateWorkItemsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
NewAzureUpdateWorkItemsTool creates a new tool instance for updating work items.
func NewAzureWorkItemCommentsTool ¶
func NewAzureWorkItemCommentsTool(conn *azuredevops.Connection, config AzureDevOpsConfig) core.Tool
NewAzureWorkItemCommentsTool creates a new tool instance for managing work item comments
func SafeString ¶
SafeString dereferences a string pointer and returns its value, or an empty string if nil.
Types ¶
type AzureCreateSprintTool ¶
type AzureCreateSprintTool struct {
// contains filtered or unexported fields
}
AzureCreateSprintTool provides functionality to create new sprints (iterations).
func (*AzureCreateSprintTool) Handle ¶
func (tool *AzureCreateSprintTool) Handle() mcp.Tool
func (*AzureCreateSprintTool) Handler ¶
func (tool *AzureCreateSprintTool) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
type AzureCreateWorkItemsTool ¶
type AzureCreateWorkItemsTool struct {
// contains filtered or unexported fields
}
AzureCreateWorkItemsTool provides functionality to create new work items in bulk with custom fields.
func (*AzureCreateWorkItemsTool) Handle ¶
func (tool *AzureCreateWorkItemsTool) Handle() mcp.Tool
func (*AzureCreateWorkItemsTool) Handler ¶
func (tool *AzureCreateWorkItemsTool) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
type AzureDevOpsConfig ¶
type AzureDevOpsConfig struct { OrganizationURL string PersonalAccessToken string Project string Team string }
AzureDevOpsConfig contains configuration for Azure DevOps integration
type AzureEnrichWorkItemTool ¶
type AzureEnrichWorkItemTool struct {
// contains filtered or unexported fields
}
AzureEnrichWorkItemTool provides functionality to search across platforms for information related to a work item.
func (*AzureEnrichWorkItemTool) Handle ¶
func (tool *AzureEnrichWorkItemTool) Handle() mcp.Tool
Handle returns the MCP tool handle.
func (*AzureEnrichWorkItemTool) Handler ¶
func (tool *AzureEnrichWorkItemTool) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
Handler is the main execution function for the enrich work item tool.
type AzureExecuteWiqlTool ¶
type AzureExecuteWiqlTool struct {
// contains filtered or unexported fields
}
AzureExecuteWiqlTool provides functionality to execute WIQL queries.
func (*AzureExecuteWiqlTool) Handle ¶
func (tool *AzureExecuteWiqlTool) Handle() mcp.Tool
func (*AzureExecuteWiqlTool) Handler ¶
func (tool *AzureExecuteWiqlTool) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
Handler executes the WIQL query.
type AzureFindItemsByStatusTool ¶
type AzureFindItemsByStatusTool struct {
// contains filtered or unexported fields
}
AzureFindItemsByStatusTool provides functionality to find work items by status
func (*AzureFindItemsByStatusTool) Handle ¶
func (tool *AzureFindItemsByStatusTool) Handle() mcp.Tool
func (*AzureFindItemsByStatusTool) Handler ¶
func (tool *AzureFindItemsByStatusTool) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
type AzureGetGitHubFileContentTool ¶
type AzureGetGitHubFileContentTool struct {
// contains filtered or unexported fields
}
AzureGetGitHubFileContentTool provides functionality to retrieve the content of a file from GitHub.
func (*AzureGetGitHubFileContentTool) Handle ¶
func (tool *AzureGetGitHubFileContentTool) Handle() mcp.Tool
Handle returns the MCP tool handle.
func (*AzureGetGitHubFileContentTool) Handler ¶
func (tool *AzureGetGitHubFileContentTool) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
Handler is the main execution function for the get GitHub file content tool.
type AzureGetSprintsTool ¶
type AzureGetSprintsTool struct {
// contains filtered or unexported fields
}
AzureGetSprintsTool provides functionality to list sprints (iterations).
func (*AzureGetSprintsTool) Handle ¶
func (tool *AzureGetSprintsTool) Handle() mcp.Tool
func (*AzureGetSprintsTool) Handler ¶
func (tool *AzureGetSprintsTool) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
type AzureGetWorkItemsTool ¶
type AzureGetWorkItemsTool struct {
// contains filtered or unexported fields
}
AzureGetWorkItemsTool provides functionality to get work item details
func (*AzureGetWorkItemsTool) Handle ¶
func (tool *AzureGetWorkItemsTool) Handle() mcp.Tool
func (*AzureGetWorkItemsTool) Handler ¶
func (tool *AzureGetWorkItemsTool) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
type AzureSearchWorkItemsTool ¶
type AzureSearchWorkItemsTool struct {
// contains filtered or unexported fields
}
AzureSearchWorkItemsTool provides functionality to search for work items.
func (*AzureSearchWorkItemsTool) Handle ¶
func (tool *AzureSearchWorkItemsTool) Handle() mcp.Tool
func (*AzureSearchWorkItemsTool) Handler ¶
func (tool *AzureSearchWorkItemsTool) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
type AzureSprintItemsTool ¶
type AzureSprintItemsTool struct {
// contains filtered or unexported fields
}
AzureSprintItemsTool provides functionality to find work items in the current sprint
func (*AzureSprintItemsTool) Handle ¶
func (tool *AzureSprintItemsTool) Handle() mcp.Tool
func (*AzureSprintItemsTool) Handler ¶
func (tool *AzureSprintItemsTool) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
type AzureSprintOverviewTool ¶
type AzureSprintOverviewTool struct {
// contains filtered or unexported fields
}
AzureSprintOverviewTool provides functionality to get an overview of a sprint.
func (*AzureSprintOverviewTool) Handle ¶
func (tool *AzureSprintOverviewTool) Handle() mcp.Tool
func (*AzureSprintOverviewTool) Handler ¶
func (tool *AzureSprintOverviewTool) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
type AzureUpdateWorkItemsTool ¶
type AzureUpdateWorkItemsTool struct {
// contains filtered or unexported fields
}
AzureUpdateWorkItemsTool provides functionality to update multiple work items in Azure DevOps.
func (*AzureUpdateWorkItemsTool) Handle ¶
func (tool *AzureUpdateWorkItemsTool) Handle() mcp.Tool
func (*AzureUpdateWorkItemsTool) Handler ¶
func (tool *AzureUpdateWorkItemsTool) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
type AzureWorkItemCommentsTool ¶
type AzureWorkItemCommentsTool struct {
// contains filtered or unexported fields
}
AzureWorkItemCommentsTool provides functionality to manage comments on work items
func (*AzureWorkItemCommentsTool) Handle ¶
func (tool *AzureWorkItemCommentsTool) Handle() mcp.Tool
func (*AzureWorkItemCommentsTool) Handler ¶
func (tool *AzureWorkItemCommentsTool) Handler(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
type CommentOutput ¶
type CommentOutput struct { ID int `json:"id"` Text string `json:"text"` CreatedBy string `json:"created_by"` CreatedDate string `json:"created_date"` ModifiedBy string `json:"modified_by,omitempty"` ModifiedDate string `json:"modified_date,omitempty"` }
CommentOutput defines the structure for a single comment's output.
type DetailedWorkItemOutput ¶
type DetailedWorkItemOutput struct { ID int `json:"id"` URL string `json:"url"` Fields map[string]any `json:"fields"` // All raw fields, includes Tags if fetched Relations *DetailedWorkItemRelationOutput `json:"relations,omitempty"` Comments []string `json:"comments,omitempty"` Tags string `json:"tags,omitempty"` // Extracted for convenience // Specific, commonly used fields for text formatting, can be extracted from Fields Title string `json:"-"` Type string `json:"-"` State string `json:"-"` AssignedTo string `json:"-"` IterationPath string `json:"-"` AreaPath string `json:"-"` Description string `json:"-"` }
DetailedWorkItemOutput defines the structure for detailed work item information for output.
type DetailedWorkItemRelationOutput ¶
type DetailedWorkItemRelationOutput struct { Parents []int `json:"parents,omitempty"` Children []int `json:"children,omitempty"` Related []int `json:"related,omitempty"` }
DetailedWorkItemRelationOutput defines the structure for work item relations for output.
type EnrichmentResults ¶
type EnrichmentResults struct { GitHubIssuesPRs []GitHubIssueResult `json:"github_issues_prs,omitempty"` GitHubCodeResults []GitHubCodeResult `json:"github_code_results,omitempty"` SlackMessages []SlackMessageResult `json:"slack_messages,omitempty"` SentryIssues []SentryIssueResult `json:"sentry_issues,omitempty"` }
type GitHubCodeResult ¶
type GitHubIssueResult ¶
type GitHubIssueResult struct { Title string `json:"title"` URL string `json:"url"` Repo string `json:"repo"` State string `json:"state"` Body *string `json:"body,omitempty"` DiffURL *string `json:"diff_url,omitempty"` }
SearchResult structures
type RelationLink ¶
type RelationLink struct { RelType string `json:"rel_type"` // e.g., "System.LinkTypes.Hierarchy-Forward" TargetURL string `json:"target_url"` LinkAttributes map[string]string `json:"attributes,omitempty"` }
RelationLink defines structure for adding a work item relation
type RelationLinkArgs ¶
type RelationLinkArgs struct { RelType string `json:"rel_type"` // e.g., "System.LinkTypes.Hierarchy-Forward", optional if removing by ref TargetURL string `json:"target_url,omitempty"` // URL of the related work item RelationRef string `json:"relation_ref,omitempty"` // Internal reference of the link itself (e.g. from get_work_item) }
RelationLinkArgs is used for identifying relations to remove, can be by target URL or by relation reference
type SearchWorkItemOutput ¶
type SearchWorkItemOutput struct { ID int `json:"id"` Title string `json:"title"` Type string `json:"type"` State string `json:"state"` URL string `json:"url"` }
SearchWorkItemOutput defines the structure for a single work item in search results.
type SentryIssueResult ¶
type SlackMessageResult ¶
type SprintOutput ¶
type SprintOutput struct { ID string `json:"id"` Name string `json:"name"` IterationPath string `json:"iteration_path"` StartDate string `json:"start_date,omitempty"` EndDate string `json:"end_date,omitempty"` TimeFrame string `json:"time_frame,omitempty"` URL string `json:"url,omitempty"` }
SprintOutput defines the structure for a single sprint's details for output. This structure is adapted from the previous pkg/tools/azure/sprint.go
type SprintOverviewOutput ¶
type SprintOverviewOutput struct { ID string `json:"id,omitempty"` Name string `json:"name"` IterationPath string `json:"iteration_path"` StartDate string `json:"start_date,omitempty"` EndDate string `json:"end_date,omitempty"` TimeFrame string `json:"time_frame,omitempty"` URL string `json:"url,omitempty"` Goal string `json:"goal,omitempty"` // Sprint Goal, if available TotalWorkItems int `json:"total_work_items"` WorkItemsByState map[string]int `json:"work_items_by_state"` WorkItemsByType map[string]int `json:"work_items_by_type"` UniqueAssignees []string `json:"unique_assignees,omitempty"` SampleWorkItemTitles []string `json:"sample_work_item_titles,omitempty"` // A few titles for context }
SprintOverviewOutput defines the structure for the sprint overview.
type SprintWorkItemOutput ¶
type SprintWorkItemOutput struct { ID int `json:"id"` Title string `json:"title"` State string `json:"state"` Type string `json:"type"` URL string `json:"url"` AssignedTo string `json:"assigned_to,omitempty"` IterationPath string `json:"iteration_path,omitempty"` ParentIDs []int `json:"parent_ids,omitempty"` }
SprintWorkItemOutput defines the structure for work item details for output.
type WorkItemDefinition ¶
type WorkItemDefinition struct { Type string `json:"type"` Title string `json:"title"` Description string `json:"description,omitempty"` State string `json:"state,omitempty"` Priority string `json:"priority,omitempty"` ParentID string `json:"parent_id,omitempty"` AssignedTo string `json:"assigned_to,omitempty"` Iteration string `json:"iteration,omitempty"` Area string `json:"area,omitempty"` Tags string `json:"tags,omitempty"` CustomFields map[string]string `json:"custom_fields,omitempty"` }
WorkItemDefinition is used to parse the JSON input for each work item to be created.
type WorkItemUpdateDefinition ¶
type WorkItemUpdateDefinition struct { ID int `json:"id"` FieldsToUpdate map[string]any `json:"fields_to_update"` // Flexible map for all field types Comment string `json:"comment,omitempty"` // For adding a new comment AddRelations []RelationLink `json:"add_relations,omitempty"` // For adding new relations RemoveRelations []RelationLinkArgs `json:"remove_relations,omitempty"` // For removing relations by URL or Ref }
WorkItemUpdateDefinition defines the structure for updating a single work item.