You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add service dependency support
* Improve service dependency tools with validation and cleaner output
- Validate service exists via GetService before fetching dependencies/dependents
- Rename ServiceId field to ComponentId for clarity
- Remove non-functional search parameter from both tools
- Remove Locked field from serialized output
- Use empty slice instead of nil for consistent JSON output
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Add changie entry for service dependency tools
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Apply suggestions from code review
Co-authored-by: Farjaad <8631006+Farjaad@users.noreply.github.com>
* rename all service references in new field to component
---------
Co-authored-by: Wesley Ellis <wesley@opslevel.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Farjaad <8631006+Farjaad@users.noreply.github.com>
Copy file name to clipboardExpand all lines: src/cmd/root.go
+111Lines changed: 111 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -107,6 +107,13 @@ type serializedCampaign struct {
107
107
Reminder*opslevel.CampaignReminder
108
108
}
109
109
110
+
typeserializedDependencystruct {
111
+
Idstring
112
+
ComponentIdstring
113
+
Aliases []string
114
+
Notesstring
115
+
}
116
+
110
117
// AccountMetadata represents the different types of account metadata that can be fetched
111
118
typeAccountMetadatastring
112
119
@@ -768,6 +775,110 @@ For complete reference:
768
775
returnnewToolResult(campaigns, err)
769
776
})
770
777
778
+
// Register component dependencies tool
779
+
s.AddTool(
780
+
mcp.NewTool(
781
+
"componentDependencies",
782
+
mcp.WithDescription("Get all the components that a specific component depends on. Returns the dependency graph showing which components this component consumes or calls."),
783
+
mcp.WithString("componentId", mcp.Required(), mcp.Description("The id of the component to fetch dependencies for.")),
returnmcp.NewToolResultErrorFromErr("failed to get dependencies", err), nil
814
+
}
815
+
816
+
dependencies:= []serializedDependency{}
817
+
for_, edge:=rangeresp.Edges {
818
+
dep:=serializedDependency{
819
+
Id: string(edge.Id),
820
+
ComponentId: string(edge.Node.Id),
821
+
Aliases: edge.Node.Aliases,
822
+
Notes: edge.Notes,
823
+
}
824
+
dependencies=append(dependencies, dep)
825
+
}
826
+
827
+
returnnewToolResult(dependencies, nil)
828
+
})
829
+
830
+
// Register component dependents tool
831
+
s.AddTool(
832
+
mcp.NewTool(
833
+
"componentDependents",
834
+
mcp.WithDescription("Get all the components that depend on a specific component. Returns the reverse dependency graph showing which components consume or call this component."),
835
+
mcp.WithString("componentId", mcp.Required(), mcp.Description("The id of the component to fetch dependents for.")),
0 commit comments