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
List all valid packwerk packages (aka packs) in the project.
37
-
Use this to find or list packages, optionally matching a substring of the package_path.
38
-
DESC
39
-
argument:package_path,String,required: false,description: "A partial package path name to constrain the results (e.g. 'packs/product_services/payments/banks' or 'payments/banks')."
40
-
calldo |args|
41
-
Helpers.chdir
42
-
API.packages(package_path: args[:package_path])
39
+
# List packages tool
40
+
classPackagesTool < MCP::Tool
41
+
description<<~DESC
42
+
List all valid packwerk packages (aka packs) in the project.
43
+
Use this to find or list packages, optionally matching a substring of the package_path.
44
+
DESC
45
+
46
+
input_schema(
47
+
properties: {
48
+
package_path: {
49
+
type: 'string',
50
+
description: "A partial package path name to constrain the results (e.g. 'packs/product_services/payments/banks' or 'payments/banks')."
51
+
}
52
+
},
53
+
required: []
54
+
)
55
+
56
+
class << self
57
+
defcall(server_context:,package_path: nil)
58
+
result=API.packages(package_path: package_path)
59
+
60
+
MCP::Tool::Response.new([{
61
+
type: 'text',
62
+
text: result
63
+
}])
43
64
end
44
65
end
66
+
end
67
+
68
+
# Show package details tool
69
+
classPackageTool < MCP::Tool
70
+
description<<~DESC
71
+
Show the details for a specific package.
72
+
73
+
Output format:
74
+
- Package details, including dependencies and configuration
75
+
DESC
45
76
46
-
tool'package'do
47
-
description<<~DESC
48
-
Show the details for a specific package.
77
+
input_schema(
78
+
properties: {
79
+
package_path: {
80
+
type: 'string',
81
+
description: "A full relative package path (e.g. 'packs/product_services/payments/banks')."
82
+
}
83
+
},
84
+
required: ['package_path']
85
+
)
49
86
50
-
Output format:
51
-
- Package details, including dependencies and configuration
52
-
DESC
53
-
argument:package_path,String,required: true,description: "A full relative package path (e.g. 'packs/product_services/payments/banks')."
54
-
calldo |args|
87
+
class << self
88
+
defcall(package_path:,server_context:)
55
89
Helpers.chdir
56
-
API.package(package_path: args[:package_path])
90
+
result=API.package(package_path: package_path)
91
+
92
+
MCP::Tool::Response.new([{
93
+
type: 'text',
94
+
text: result
95
+
}])
57
96
end
58
97
end
98
+
end
99
+
100
+
# Package todos (violations FROM this package) tool
101
+
classPackageTodosTool < MCP::Tool
102
+
description<<~DESC
103
+
Find code that violates dependency boundaries FROM this package TO other packages.
59
104
60
-
tool'package_todos'do
61
-
description<<~DESC
62
-
Find code that violates dependency boundaries FROM this package TO other packages.
63
-
64
-
Output formats:
65
-
- Without constant_name: List of violated constants with counts
- With constant_name: Detailed examples and locations
68
-
Example:
69
-
::OtherPackage::SomeClass
70
-
example: OtherPackage::SomeClass.new
71
-
files:
72
-
- app/services/my_service.rb
73
-
DESC
74
-
argument:package_path,String,required: true,description: "The relative path of a directory containing a package.yml file (e.g. 'packs/product_services/payments/origination_banks')."
75
-
argument:constant_name,String,required: false,description: "The name of a constant to filter the results by. If provided, a more detailed list of code usage examples will be returned. (e.g. '::OtherPackage::SomeClass')"
76
-
calldo |args|
105
+
Output formats:
106
+
- Without constant_name: List of violated constants with counts
- With constant_name: Detailed examples and locations
109
+
Example:
110
+
::OtherPackage::SomeClass
111
+
example: OtherPackage::SomeClass.new
112
+
files:
113
+
- app/services/my_service.rb
114
+
DESC
115
+
116
+
input_schema(
117
+
properties: {
118
+
package_path: {
119
+
type: 'string',
120
+
description: "The relative path of a directory containing a package.yml file (e.g. 'packs/product_services/payments/origination_banks')."
121
+
},
122
+
constant_name: {
123
+
type: 'string',
124
+
description: "The name of a constant to filter the results by. If provided, a more detailed list of code usage examples will be returned. (e.g. '::OtherPackage::SomeClass')"
# Package violations (violations TO this package) tool
144
+
classPackageViolationsTool < MCP::Tool
145
+
description<<~DESC
146
+
Find code that violates dependency boundaries TO this package FROM other packages.
147
+
148
+
Output formats:
149
+
- Without constant_name: List of violated constants with counts
150
+
Example: "::ThisPackage::SomeClass: 3 violations"
151
+
- With constant_name: Detailed examples and locations
152
+
Example:
153
+
# Constant `::ThisPackage::SomeClass`
154
+
## Example:
155
+
ThisPackage::SomeClass.new
156
+
### Files:
157
+
app/services/other_service.rb
158
+
DESC
159
+
160
+
input_schema(
161
+
properties: {
162
+
package_path: {
163
+
type: 'string',
164
+
description: "The relative path of a directory containing a package.yml file (e.g. 'packs/product_services/payments/origination_banks'). AKA a 'pack' or 'package'."
165
+
},
166
+
constant_name: {
167
+
type: 'string',
168
+
description: 'The name of a constant to filter the results by. If provided, a more detailed list of code usage examples will be returned.'
169
+
}
170
+
},
171
+
required: ['package_path']
172
+
)
81
173
82
-
tool'package_violations'do
83
-
description<<~DESC
84
-
Find code that violates dependency boundaries TO this package FROM other packages.
85
-
86
-
Output formats:
87
-
- Without constant_name: List of violated constants with counts
88
-
Example: "::ThisPackage::SomeClass: 3 violations"
89
-
- With constant_name: Detailed examples and locations
90
-
Example:
91
-
# Constant `::ThisPackage::SomeClass`
92
-
## Example:
93
-
ThisPackage::SomeClass.new
94
-
### Files:
95
-
app/services/other_service.rb
96
-
DESC
97
-
argument:package_path,String,required: true,description: "The relative path of a directory containing a package.yml file (e.g. 'packs/product_services/payments/origination_banks'). AKA a 'pack' or 'package'."
98
-
argument:constant_name,String,required: false,description: 'The name of a constant to filter the results by. If provided, a more detailed list of code usage examples will be returned.'
0 commit comments